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

✨ amp-animation internals can take a scope element #27887

Merged
merged 7 commits into from
Apr 21, 2020

Conversation

alanorozco
Copy link
Member

Partial for #27758

Builder now takes options: {scope: (!Node|undefined)}. This scopes the selector in the effect spec.

<amp-story-animation> scopes to its parent <amp-story-page>.

@alanorozco alanorozco marked this pull request as ready for review April 21, 2020 18:17
@amp-owners-bot
Copy link

amp-owners-bot bot commented Apr 21, 2020

Hey @newmuis, these files were changed:

extensions/amp-story/1.0/animation-types.js
extensions/amp-story/1.0/animation.js
extensions/amp-story/1.0/test/test-animation.js

extensions/amp-animation/0.1/web-animations.js Outdated Show resolved Hide resolved
extensions/amp-animation/0.1/web-animations.js Outdated Show resolved Hide resolved
extensions/amp-animation/0.1/web-animations.js Outdated Show resolved Hide resolved
extensions/amp-story/1.0/animation.js Outdated Show resolved Hide resolved
extensions/amp-animation/0.1/web-animations.js Outdated Show resolved Hide resolved
@@ -60,7 +64,7 @@ const DEFAULT_EASING = 'cubic-bezier(0.4, 0.0, 0.2, 1)';
* TODO(alanorozco): maybe memoize?
*/
export function hasAnimations(element) {
const selector = `${ANIMATABLE_ELEMENTS_SELECTOR},amp-story-animation`;
const selector = `${ANIMATABLE_ELEMENTS_SELECTOR},>amp-story-animation`;
Copy link
Contributor

Choose a reason for hiding this comment

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

TIL that scopedQuerySelector accepts comma-separated selectors. This is cool.

Copy link
Member Author

Choose a reason for hiding this comment

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

It's been able for a little over a year now, I think :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants