♻️[amp story page advancement] handle clicks on drawer#36715
Merged
processprocess merged 1 commit intoampproject:mainfrom Nov 2, 2021
Merged
♻️[amp story page advancement] handle clicks on drawer#36715processprocess merged 1 commit intoampproject:mainfrom
processprocess merged 1 commit intoampproject:mainfrom
Conversation
|
Hey @gmajoulet, @newmuis! These files were changed: |
coreymasanto
approved these changes
Nov 2, 2021
gmajoulet
reviewed
Nov 3, 2021
| tagName === 'amp-story-page-attachment' || | ||
| tagName === 'amp-story-page-outlink' | ||
| ) { | ||
| if (el.classList.contains('amp-story-draggable-drawer-root')) { |
Contributor
There was a problem hiding this comment.
No need to revert, I'm just trying to offer an alternative argument to consider next times we want to do such optimizations.
The previous implementation had the advantage of being much easier to understand for people with 0 context, making the codebase a bit more accessible. It used to read as "content within page-attachment or page-outlink don't trigger page advancement". Now with this class it's a bit less obvious.
Contributor
Author
There was a problem hiding this comment.
Agree that this needs a comment. Opened #36764
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This simplifies the handle event check when a click is inside a draggable drawer.
This checks if the element is a draggable drawer rather than checking the tag name of elements that extend the draggable drawer.
This will be helpful in the future - when other elements extend draggable drawer (such as
amp-story-shopping-attachment), we will not need to add another tag to this list.