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

View file

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

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>