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

Ignore links with specific data attribute in href() listener #27

Merged
merged 3 commits into from
Aug 18, 2016
Merged

Ignore links with specific data attribute in href() listener #27

merged 3 commits into from
Aug 18, 2016

Conversation

jliuhtonen
Copy link
Contributor

Like described in issue #15, it is sometimes necessary to create links that are not handled with the SPA router, like paths that are handled by an external 3rd party system.

This PR implements ignoring specified links by adding data-no-routing attribute to the <a> element. Because of compatibility reasons there are two ways of using this, data-no-routing (boolean attribute) or data-no-routing="true" (string attribute, the value can be anything).

@yoshuawuyts yoshuawuyts mentioned this pull request Jul 31, 2016
24 tasks
@jliuhtonen
Copy link
Contributor Author

Added a fix for issue where secondary mouse button clicks were captured and key combinations, like cmd-clicking on a mac, did not work as expected.

- Ignore other pointer device button clicks than the main button
- Ignore clicks when ctrl, alt, meta (cmd or windows key) have been
  pressed, so key combinations will work (like open link to a new tab
with cmd+click on a mac).
@yoshuawuyts
Copy link
Owner

This looks good to me! - I reckon we ought to have tests for this though; would you be willing to add those for the href file, perhaps in a separate patch? - heaps thanks for taking your time to submit this, apologies I didn't get around to merging this sooner!

@yoshuawuyts yoshuawuyts merged commit 68035b6 into yoshuawuyts:master Aug 18, 2016
@yoshuawuyts
Copy link
Owner

I released this as 3.2.0 and then had to unrelease again because accidental changes were pulled in. Oops, apologies! haha

@jliuhtonen
Copy link
Contributor Author

Thanks! I agree that this functionality should have tests. I'm interested
in implementing them, so I'll give it a shot when I have time.

On Thursday, 18 August 2016, Yoshua Wuyts [email protected] wrote:

This looks good to me! - I reckon we ought to have tests for this though;
would you be willing to add those for the href file, perhaps in a
separate patch? - heaps thanks for taking your time to submit this,
apologies I didn't get around to merging this sooner!


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#27 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AA-aTXTcpIeW3j5C-lUM81pyHqepkRPrks5qhF9agaJpZM4JI3xw
.

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

Successfully merging this pull request may close these issues.

2 participants