Improved tab close message/button.

This commit is contained in:
Martin Edenhofer 2014-09-25 14:22:50 +02:00
parent 6cb02eecec
commit 149d00e89f
3 changed files with 15 additions and 12 deletions

View file

@ -444,6 +444,7 @@ class App.ControllerModal extends App.Controller
keyboard: true
close: true
head: '?'
buttonClass: 'btn--success'
options = _.extend( defaults, options )
@ -467,6 +468,7 @@ class App.ControllerModal extends App.Controller
close: @close
cancel: @cancel
button: @button
buttonClass: @buttonClass
) )
if @el && !@message && !@detail
@modalElement.find('.modal-body').html @el

View file

@ -121,7 +121,8 @@ class Remove extends App.ControllerModal
@message = 'Tab has changed, you really want to close it?'
@cancel = true
@close = true
@button = 'Close'
@button = 'Discared changes'
@buttonClass = 'btn--danger'
@show()
onSubmit: (e) =>

View file

@ -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>