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

Fix Sidebar navigations being cancelled. #6590

Merged
merged 3 commits into from
Dec 9, 2016

Conversation

mkhatib
Copy link
Contributor

@mkhatib mkhatib commented Dec 9, 2016

Fixes #6585

this.close_();
const tgtLoc = parseUrl(target.href);
const curLoc = parseUrl(this.getAmpDoc().win.location.href);
const tgtHref = `${tgtLoc.origin}${tgtLoc.pathname}${tgtLoc.search}`;
Copy link
Member

Choose a reason for hiding this comment

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

Instead compare removeFragment(a.href) == removeFragment(b.href)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. Should i keep the check for tgt.hash still or just close if the navigation is not to a new page? I think it's not entirely needed but a bit safer and we can relax it moving forward.

@@ -282,11 +282,91 @@ describe('amp-sidebar', () => {
});
});

it('should reflect state of the sidebar', () => {
Copy link
Contributor Author

@mkhatib mkhatib Dec 9, 2016

Choose a reason for hiding this comment

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

Not sure why github thinks I added this 😩

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think the git diff just messed up

@mkhatib
Copy link
Contributor Author

mkhatib commented Dec 9, 2016

Added tests PTAL 👀

},
};
});
anchor.dispatchEvent ?
Copy link
Contributor

Choose a reason for hiding this comment

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

not blocking you on this , may be we should move this to a integration test.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Filed #6593 to refactor this in future

Copy link
Member

@cramforce cramforce left a comment

Choose a reason for hiding this comment

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

LGTM

@mkhatib mkhatib merged commit 10bead8 into ampproject:master Dec 9, 2016
@mkhatib mkhatib deleted the debug-sidebar branch December 9, 2016 21:30
Lith pushed a commit to Lith/amphtml that referenced this pull request Dec 22, 2016
Lith pushed a commit to Lith/amphtml that referenced this pull request Dec 22, 2016
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