Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bootstrap modal "shown" event not working when "animate" property is set to "false" #57

Open
titaniumteeth opened this issue Jan 20, 2014 · 4 comments

Comments

@titaniumteeth
Copy link

If I set animate: true, then shown event is working just fine.

Issue demo: http://jsfiddle.net/nzLSA/40/

@betaprior
Copy link

I can confirm this.

@DavsX
Copy link

DavsX commented Jul 28, 2014

Confirming as well.

@marcovc
Copy link

marcovc commented Feb 23, 2015

+1

@dieselmachine
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants