From 149d00e89f69aa93f6b03bac47e44cdab9215944 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Thu, 25 Sep 2014 14:22:50 +0200 Subject: [PATCH] Improved tab close message/button. --- .../controllers/_application_controller.js.coffee | 14 ++++++++------ .../app/controllers/taskbar_widget.js.coffee | 11 ++++++----- app/assets/javascripts/app/views/modal.jst.eco | 2 +- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/app/assets/javascripts/app/controllers/_application_controller.js.coffee b/app/assets/javascripts/app/controllers/_application_controller.js.coffee index 648f222e5..1228c7016 100644 --- a/app/assets/javascripts/app/controllers/_application_controller.js.coffee +++ b/app/assets/javascripts/app/controllers/_application_controller.js.coffee @@ -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 = $( '' ) @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 diff --git a/app/assets/javascripts/app/controllers/taskbar_widget.js.coffee b/app/assets/javascripts/app/controllers/taskbar_widget.js.coffee index bf7f638e1..c2495436e 100644 --- a/app/assets/javascripts/app/controllers/taskbar_widget.js.coffee +++ b/app/assets/javascripts/app/controllers/taskbar_widget.js.coffee @@ -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) => diff --git a/app/assets/javascripts/app/views/modal.jst.eco b/app/assets/javascripts/app/views/modal.jst.eco index 2d8b2e8c9..25d9088ce 100644 --- a/app/assets/javascripts/app/views/modal.jst.eco +++ b/app/assets/javascripts/app/views/modal.jst.eco @@ -22,7 +22,7 @@ <%- @T( 'Cancel & Go Back' ) %> <% end %> <% if @button: %> - + <% end %>