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

Preserve full URL when using 'anchor' function. #12

Merged
merged 5 commits into from
Sep 17, 2015

Conversation

nikuda
Copy link
Collaborator

@nikuda nikuda commented Aug 28, 2015

At the moment the url is replaced with hash, which has a negative impact on usability - i.e. you're not able to ctrl+click to open up a link in a new tab etc. With this patch the full url is rendered, while still being intercepted by mercury-router so you don't get an app-reload by clicking them directly.

  • Moved the more complete example from lib/router.js into readme.md. And removed the old one.
  • Simplified testing and added test for new anchor behaviour.

@nikuda
Copy link
Collaborator Author

nikuda commented Aug 28, 2015

@Raynos do you see any potential issues with this? The meat of the change is this a315fee.

@@ -20,6 +17,6 @@ function anchor(props, text) {
return h('a', props, text);

function pushState() {
routeAtom.set(href);
routeAtom.set(props.href);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@nikuda
Copy link
Collaborator Author

nikuda commented Sep 17, 2015

@twilson63, fwiw - this patch is ok we've been using this for the last couple of weeks without issues.

twilson63 pushed a commit that referenced this pull request Sep 17, 2015
Preserve full URL when using 'anchor' function.
@twilson63 twilson63 merged commit 8df66d9 into twilson63:master Sep 17, 2015
@twilson63
Copy link
Owner

merged

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.

3 participants