From 568c0575d3c85f6a948e921f64096168bca34bb5 Mon Sep 17 00:00:00 2001 From: Felix Niklas Date: Mon, 29 Jun 2015 17:01:22 +0200 Subject: [PATCH] add onComplete parameter to ControllerModal gets called on @onShown --- .../app/controllers/_application_controller.js.coffee | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/app/controllers/_application_controller.js.coffee b/app/assets/javascripts/app/controllers/_application_controller.js.coffee index 228d65d39..5bbb9ac4f 100644 --- a/app/assets/javascripts/app/controllers/_application_controller.js.coffee +++ b/app/assets/javascripts/app/controllers/_application_controller.js.coffee @@ -546,6 +546,7 @@ class App.ControllerModal extends App.Controller buttonClass: 'btn--success' centerButtons: [] container: null + onComplete: (->) options = _.extend( defaults, options ) @@ -582,7 +583,7 @@ class App.ControllerModal extends App.Controller container: @container .on 'show.bs.modal': @onShow - 'shown.bs.modal': @onShown + 'shown.bs.modal': @onComplete 'hidden.bs.modal': => @onHide() # remove modal from dom @@ -593,7 +594,8 @@ class App.ControllerModal extends App.Controller e.preventDefault() @el.modal('hide') - onShown: -> + onShown: => + @onComplete() console.log('modal shown: do nothing') # do nothing