Improved tab close message/button.
This commit is contained in:
parent
6cb02eecec
commit
149d00e89f
3 changed files with 15 additions and 12 deletions
|
@ -444,6 +444,7 @@ class App.ControllerModal extends App.Controller
|
|||
keyboard: true
|
||||
close: true
|
||||
head: '?'
|
||||
buttonClass: 'btn--success'
|
||||
|
||||
options = _.extend( defaults, options )
|
||||
|
||||
|
@ -461,12 +462,13 @@ class App.ControllerModal extends App.Controller
|
|||
|
||||
@modalElement = $( '<div class="modal fade"></div>' )
|
||||
@modalElement.append $( App.view('modal')(
|
||||
head: @head
|
||||
message: @message
|
||||
detail: @detail
|
||||
close: @close
|
||||
cancel: @cancel
|
||||
button: @button
|
||||
head: @head
|
||||
message: @message
|
||||
detail: @detail
|
||||
close: @close
|
||||
cancel: @cancel
|
||||
button: @button
|
||||
buttonClass: @buttonClass
|
||||
) )
|
||||
if @el && !@message && !@detail
|
||||
@modalElement.find('.modal-body').html @el
|
||||
|
|
|
@ -117,11 +117,12 @@ class App.TaskbarWidget extends App.Controller
|
|||
class Remove extends App.ControllerModal
|
||||
constructor: ->
|
||||
super
|
||||
@head = 'Confirm'
|
||||
@message = 'Tab has changed, you really want to close it?'
|
||||
@cancel = true
|
||||
@close = true
|
||||
@button = 'Close'
|
||||
@head = 'Confirm'
|
||||
@message = 'Tab has changed, you really want to close it?'
|
||||
@cancel = true
|
||||
@close = true
|
||||
@button = 'Discared changes'
|
||||
@buttonClass = 'btn--danger'
|
||||
@show()
|
||||
|
||||
onSubmit: (e) =>
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
<a class="subtle-link standalone js-cancel" href="#/"><%- @T( 'Cancel & Go Back' ) %></a>
|
||||
<% end %>
|
||||
<% if @button: %>
|
||||
<button type="submit" class="btn btn--success js-submit align-right"><%- @T( @button ) %></button>
|
||||
<button type="submit" class="btn <%= @buttonClass %> js-submit align-right"><%- @T( @button ) %></button>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue