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

Is there is any callback for modal ?? like slider and push #849

Open
Toomavic opened this issue Nov 30, 2016 · 7 comments
Open

Is there is any callback for modal ?? like slider and push #849

Toomavic opened this issue Nov 30, 2016 · 7 comments

Comments

@Toomavic
Copy link

No description provided.

@Johann-S
Copy link
Member

You have modalClose and modalOpen events
https://github.com/twbs/ratchet/blob/master/js/modals.js#L37-L43

@Toomavic
Copy link
Author

Thanks Johann
and using them will be like
window.addEventListener('modalOpen', myFunction, false); myFunction(){ }

??

@Johann-S
Copy link
Member

Not on the window object but on the modal object. If your modal has an ID you can do :

var myModal = document.getElementById('modalTest');
function myFunction () { }
myModal.addEventListener('modalOpen', myFunction);

@Toomavic
Copy link
Author

what happens if I make it on window object ?

@Johann-S
Copy link
Member

It wont work because modal object triggered the event

@Toomavic
Copy link
Author

Thanks :))))))

@Toomavic
Copy link
Author

Another issue I found ,
Let's say you have two pages linked with push.js , and suppose that every page has its own js code.

what I found is the js code for the second page is not loaded when I move between the two pages,
so what I did is , I put all js code in the first page and it is working now

Is that the true way to handle js code for every page??!
what if I have many pages !

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