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
|
keyboard: true
|
||||||
close: true
|
close: true
|
||||||
head: '?'
|
head: '?'
|
||||||
|
buttonClass: 'btn--success'
|
||||||
|
|
||||||
options = _.extend( defaults, options )
|
options = _.extend( defaults, options )
|
||||||
|
|
||||||
|
@ -461,12 +462,13 @@ class App.ControllerModal extends App.Controller
|
||||||
|
|
||||||
@modalElement = $( '<div class="modal fade"></div>' )
|
@modalElement = $( '<div class="modal fade"></div>' )
|
||||||
@modalElement.append $( App.view('modal')(
|
@modalElement.append $( App.view('modal')(
|
||||||
head: @head
|
head: @head
|
||||||
message: @message
|
message: @message
|
||||||
detail: @detail
|
detail: @detail
|
||||||
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
|
||||||
|
|
|
@ -117,11 +117,12 @@ class App.TaskbarWidget extends App.Controller
|
||||||
class Remove extends App.ControllerModal
|
class Remove extends App.ControllerModal
|
||||||
constructor: ->
|
constructor: ->
|
||||||
super
|
super
|
||||||
@head = 'Confirm'
|
@head = 'Confirm'
|
||||||
@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) =>
|
||||||
|
|
|
@ -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>
|
||||||
|
|
Loading…
Reference in a new issue