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

create modal and hide and show all script listener lost. #252

Open
lxbzmy opened this issue Sep 15, 2014 · 4 comments
Open

create modal and hide and show all script listener lost. #252

lxbzmy opened this issue Sep 15, 2014 · 4 comments

Comments

@lxbzmy
Copy link

lxbzmy commented Sep 15, 2014

  • use js create modal and bind listener on content .
  • hide modal.
  • trigger show modal again.
    script bind lost.

because modal dom removed from dom tree. This not happened in official bootstrap-modal.

I add modal.appendTo($(document)); to removeContainer to solve problem

removeContainer: function (modal) {
            modal.appendTo($(document));
            modal.$container.remove();
            modal.$container = null;
        },
@aricca
Copy link

aricca commented Sep 11, 2015

I am having the same problem! script bind lost. Where did you add that function ? Thanks!

@lxbzmy
Copy link
Author

lxbzmy commented Sep 13, 2015

removeContainer is a function from bootstrap-modalmanager.js.

@aricca
Copy link

aricca commented Sep 16, 2015

I tried adding it but I get the message:
"Uncaught TypeError: modal.appendTo is not a function"

I am destroying the modal and recreating it, not the best.. but for now it works. I don't know if this maybe the same problem why I also get dropbox items cropped out of modal ...

@lxbzmy
Copy link
Author

lxbzmy commented Sep 21, 2015

modal.$element.appendTo($('body')); 

my mistake.

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