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