Fixed #159 - attachment lost with no text. Introduced small modals for alerts.
This commit is contained in:
parent
dcc6f60b26
commit
4e6e03a494
4 changed files with 34 additions and 16 deletions
|
@ -590,12 +590,14 @@ class App.ControllerModalNice extends App.Controller
|
|||
backdrop: true
|
||||
keyboard: true
|
||||
large: false
|
||||
small: false
|
||||
head: '?'
|
||||
container: null
|
||||
buttonClass: 'btn--success'
|
||||
centerButtons: []
|
||||
buttonClose: true
|
||||
buttonCancel: false
|
||||
buttonCancelClass: 'btn--text btn--subtle'
|
||||
buttonSubmit: true
|
||||
headPrefix: ''
|
||||
shown: true
|
||||
|
@ -609,7 +611,6 @@ class App.ControllerModalNice extends App.Controller
|
|||
className: 'modal fade'
|
||||
|
||||
constructor: ->
|
||||
@className += ' modal--large' if @large
|
||||
super
|
||||
|
||||
# rerender view, e. g. on langauge change
|
||||
|
@ -631,15 +632,16 @@ class App.ControllerModalNice extends App.Controller
|
|||
else
|
||||
content = @content()
|
||||
modal = $(App.view('modal')
|
||||
head: @head
|
||||
headPrefix: @headPrefix
|
||||
message: @message
|
||||
detail: @detail
|
||||
buttonClose: @buttonClose
|
||||
buttonCancel: @buttonCancel
|
||||
buttonSubmit: @buttonSubmit
|
||||
buttonClass: @buttonClass
|
||||
centerButtons: @centerButtons
|
||||
head: @head
|
||||
headPrefix: @headPrefix
|
||||
message: @message
|
||||
detail: @detail
|
||||
buttonClose: @buttonClose
|
||||
buttonCancel: @buttonCancel
|
||||
buttonCancelClass: @buttonCancelClass
|
||||
buttonSubmit: @buttonSubmit
|
||||
buttonClass: @buttonClass
|
||||
centerButtons: @centerButtons
|
||||
)
|
||||
modal.find('.modal-body').html content
|
||||
if !@initRenderingDone
|
||||
|
@ -662,6 +664,10 @@ class App.ControllerModalNice extends App.Controller
|
|||
|
||||
if @container
|
||||
@el.addClass('modal--local')
|
||||
if @large
|
||||
@el.addClass('modal--large')
|
||||
if @small
|
||||
@el.addClass('modal--small')
|
||||
|
||||
@el.modal
|
||||
keyboard: @keyboard
|
||||
|
|
|
@ -571,10 +571,19 @@ class App.TicketZoom extends App.Controller
|
|||
# check if attachment exists but no body
|
||||
attachmentCount = @$('.article-add .textBubble .attachments .attachment').length
|
||||
if !articleParams['body'] && attachmentCount > 0
|
||||
if !confirm( App.i18n.translateContent('Please fill also some text in!') )
|
||||
@formEnable(e)
|
||||
@autosaveStart()
|
||||
return
|
||||
new App.ControllerModalNice(
|
||||
head: 'Text missing'
|
||||
buttonCancel: 'Cancel'
|
||||
buttonCancelClass: 'btn--danger'
|
||||
buttonSubmit: false
|
||||
message: 'Please fill also some text in!'
|
||||
shown: true
|
||||
small: true
|
||||
container: @el.closest('.content')
|
||||
)
|
||||
@formEnable(e)
|
||||
@autosaveStart()
|
||||
return
|
||||
|
||||
if articleParams['body']
|
||||
articleParams.from = @Session.get().displayName()
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<div class="modal-footer">
|
||||
<% if @buttonCancel: %>
|
||||
<div class="modal-leftFooter">
|
||||
<a class="btn btn--text btn--subtle js-cancel align-left" href="#/"><%- @T(@buttonCancel) %></a>
|
||||
<a class="btn <%= @buttonCancelClass %> js-cancel align-left" href="#/"><%- @T(@buttonCancel) %></a>
|
||||
</div>
|
||||
<% end %>
|
||||
<% for button in @centerButtons: %>
|
||||
|
|
|
@ -5255,7 +5255,7 @@ footer {
|
|||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
|
||||
svg {
|
||||
fill: white;
|
||||
}
|
||||
|
@ -5275,6 +5275,9 @@ footer {
|
|||
.modal--large .modal-dialog {
|
||||
max-width: 740px;
|
||||
}
|
||||
.modal--small .modal-dialog {
|
||||
max-width: 440px;
|
||||
}
|
||||
.modal-dialog.wizard {
|
||||
max-width: 460px;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue