backbone.bootstrap-modal
backbone.bootstrap-modal copied to clipboard
Bootstrap modal "shown" event not working when "animate" property is set to "false"
If I set animate: true, then shown event is working just fine.
Issue demo: http://jsfiddle.net/nzLSA/40/
I can confirm this.
Confirming as well.
+1
The 'shown.bs.modal' event is triggered by
$el.modal({
keyboard: this.options.allowCancel,
backdrop: this.options.allowCancel ? true : 'static'
});
The event binding follows immediately after, so the event listener doesn't exist when the event is triggered.
It appears that in the master branch, the code now looks like this:
$el.modal(_.extend({
keyboard: this.options.allowCancel,
backdrop: this.options.allowCancel ? true : 'static'
}, this.options.modalOptions));
So in theory (i havent tested this yet) you could add 'show': false to the options and have it create but not display the modal, then the event listener would be added, then you could show the modal at your leisure and the event should be handled.