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

'hidden' event is not caught #8

Open
sufish opened this issue Aug 26, 2012 · 1 comment
Open

'hidden' event is not caught #8

sufish opened this issue Aug 26, 2012 · 1 comment

Comments

@sufish
Copy link

sufish commented Aug 26, 2012

in my environment, MacOX, Chrome, following potion of code of 'backone-bootstrap-modal.js' is not working as expected, the code handling 'hidden' event is not executed

close: function() {
            var self = this,
                $el = this.$el;

            //Check if the modal should stay open
            if (this._preventClose) {
                this._preventClose = false;
                return;
            }
            $el.modal('hide');

            $el.one('hidden', function() {
                self.remove();

                self.trigger('hidden');
            });

the reason is that the event bind is called after "modal('hide')" or to say the event bind is execute after the event had happened, i temporally worked around it by switch the order like following

           $el.one('hidden', function() {
                self.remove();

                self.trigger('hidden');
            });

            $el.modal('hide'); 

i dont know if orignal code works on other environment , i think it would be good to bind the event at the initialization, like in the open or render method

stephanebachelier added a commit to stephanebachelier/backbone.bootstrap-modal that referenced this issue Sep 11, 2012
mattvoss added a commit to mattvoss/backbone.bootstrap-modal that referenced this issue Apr 27, 2013
@mqklin
Copy link

mqklin commented Dec 31, 2015

@stephanebachelier , thx you very much

chloegugli added a commit to chloegugli/studio that referenced this issue Aug 13, 2018
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

2 participants