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 keyboard: true
close: true close: true
head: '?' head: '?'
buttonClass: 'btn--success'
options = _.extend( defaults, options ) options = _.extend( defaults, options )
@ -467,6 +468,7 @@ class App.ControllerModal extends App.Controller
close: @close close: @close
cancel: @cancel cancel: @cancel
button: @button button: @button
buttonClass: @buttonClass
) ) ) )
if @el && !@message && !@detail if @el && !@message && !@detail
@modalElement.find('.modal-body').html @el @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?' @message = 'Tab has changed, you really want to close it?'
@cancel = true @cancel = true
@close = true @close = true
@button = 'Close' @button = 'Discared changes'
@buttonClass = 'btn--danger'
@show() @show()
onSubmit: (e) => onSubmit: (e) =>

View file

@ -22,7 +22,7 @@
<a class="subtle-link standalone js-cancel" href="#/"><%- @T( 'Cancel & Go Back' ) %></a> <a class="subtle-link standalone js-cancel" href="#/"><%- @T( 'Cancel & Go Back' ) %></a>
<% end %> <% end %>
<% if @button: %> <% 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 %> <% end %>
</div> </div>
</div> </div>