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
Improve click handling when pushstate is activated. #28
Conversation
- Handle javascript void - Handle target blank - Handle metkey click
can-route-pushstate.js
Outdated
// href has some JS in it, let it run | ||
if(node.href.trim().indexOf('javascript') === 0) { | ||
try { | ||
eval(node.href); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you don't call ev.preventDefault()
... which should happen just by returning, won't it do the browser's default behavior?
Also, you might want to check for javascript:
... less likely someone has a link like javascript.com
or something.
can-route-pushstate.js
Outdated
} | ||
|
||
// Do not push state if meta key was pressed, mimicing standard browser behavior | ||
if (e.metaKey) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might need to check for other modifier keys: https://github.com/canjs/bit-docs-html-canjs/pull/205/files#diff-8efd6c52b5a29c345f4c332394b874d5
can-route-pushstate listens on the body ... one idea is to have a plugin "beat" |
|
Closing in favor of #77 |
Resolves #23