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

onclick handler fails to ignore links that contain (but dont start with) the base url #234

Closed
spudly opened this issue Mar 10, 2015 · 3 comments

Comments

@spudly
Copy link

spudly commented Mar 10, 2015

If a link does not starts with the baseUrl, it should be ignored by the onclick handler and should continue to have their native behavior.

Any link whose pathname contains (not starts-with) the base url will fail to be ignored by the onClick handler. As a result, links that should actually go to a different page are triggering page.js routes instead.

For example, if my app has a base url of "/b", the link below should be ignored by the onClick handler, and the native behavior (opening that url) should be preserved:

<a href="/a/b/c.html">Some File</a>

But instead, the onclick handler prevents the default action and calls page.show('/a/b/c.html')

I'll submit a pull request...

A added a commit that referenced this issue Mar 10, 2015
Improved click handler behavior. Fixes #233 and #234.
@codinfox
Copy link

Please update the documentation as well.

@spudly spudly closed this as completed Mar 25, 2015
@clayrisser
Copy link

Wow, I completely disagree with this. At the very least, you should have the option to not use it that way. With this current setup, if someone decides to change the base, you have to go through your entire codebase to change it. That's nasty and super not cool.

@clayrisser
Copy link

Just did a pull request to fix this. #418

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

3 participants