add onComplete parameter to ControllerModal

gets called on @onShown
This commit is contained in:
Felix Niklas 2015-06-29 17:01:22 +02:00
parent 2a4da78906
commit 568c0575d3

View file

@ -546,6 +546,7 @@ class App.ControllerModal extends App.Controller
buttonClass: 'btn--success' buttonClass: 'btn--success'
centerButtons: [] centerButtons: []
container: null container: null
onComplete: (->)
options = _.extend( defaults, options ) options = _.extend( defaults, options )
@ -582,7 +583,7 @@ class App.ControllerModal extends App.Controller
container: @container container: @container
.on .on
'show.bs.modal': @onShow 'show.bs.modal': @onShow
'shown.bs.modal': @onShown 'shown.bs.modal': @onComplete
'hidden.bs.modal': => 'hidden.bs.modal': =>
@onHide() @onHide()
# remove modal from dom # remove modal from dom
@ -593,7 +594,8 @@ class App.ControllerModal extends App.Controller
e.preventDefault() e.preventDefault()
@el.modal('hide') @el.modal('hide')
onShown: -> onShown: =>
@onComplete()
console.log('modal shown: do nothing') console.log('modal shown: do nothing')
# do nothing # do nothing