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

Prevent navigation guard still updates currentChild? #201

Open
asos-tomp opened this issue Feb 24, 2015 · 1 comment
Open

Prevent navigation guard still updates currentChild? #201

asos-tomp opened this issue Feb 24, 2015 · 1 comment

Comments

@asos-tomp
Copy link

I'm experimenting with pager and history.js

I was hoping that by not firing the guard callback, pager could prevent the url changing to a new path, and prevent the old page from being hidden. As it is, although the guard prevents the new page showing, the page-href has already been actioned.

A basic fiddle with the callback not being fired shows that the first page still gets hidden when clicking Page 2. Outside of jsfiddle, the url would be updated to #page2, also.

http://jsfiddle.net/Lc1am4ah/1/

Is there any way to mitigate this? I assume I will otherwise have to "bind to global click" (http://pagerjs.com/demo/#!/navigation/custom_js_when_navigating) to control workflow, which I'm not too keen on.

@asos-tomp
Copy link
Author

Similarly, shouldn't the local click handler prevent navigation, if it doesn't return true?

http://jsfiddle.net/Lc1am4ah/2/

Seems like the click handler fires after navigation..

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

1 participant