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

Handle multiple init calls. #5

Closed
maikeldaloo opened this issue Oct 8, 2015 · 5 comments
Closed

Handle multiple init calls. #5

maikeldaloo opened this issue Oct 8, 2015 · 5 comments
Labels

Comments

@maikeldaloo
Copy link

Hi,

I just used the priorityNav plugin inside an AngularJS directive.
The directive would run priorityNav.init() after defining the settings.

But when I have 2 instances of the AngularJS directive on the page, the priorityNav.init() gets called twice, and on the 2nd call, it actually breaks all instances on the page because the wrapper element is duplicated and what happens is that the first copy has the 'hidden' links, while the second copy of the wrapper has the button event!

I have currently fixed this issue by allowing my directive to run only once. But I think a fix on your end is a lot safer.

Cheers,
Maikel

@gijsroge
Copy link
Owner

Ah, yeah thats possible. I'll try to fix it later. Thanks!

@gijsroge gijsroge added the bug label Oct 10, 2015
@lewie6
Copy link

lewie6 commented Feb 4, 2016

is it possible to add this? cheers Lew

@lewie6
Copy link

lewie6 commented Feb 9, 2016

@maikeldaloo
let me know what you think of this:
https://github.com/lewie6/ng-priority-nav

@gijsroge
Copy link
Owner

gijsroge commented Feb 9, 2016

Thanks @lewie6 I added your angular version to the readme!

@lewie6
Copy link

lewie6 commented Feb 9, 2016

thanks man!
... alternative versions... good idea, will bung the on mine too

@gijsroge gijsroge closed this as completed Jan 2, 2017
baseonmars referenced this issue in citizensadvice/priority-navigation Apr 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants