Skip to content

🐛 [amp story] Change toggleAttribute to set/removeAttribute#37420

Merged
processprocess merged 6 commits intoampproject:mainfrom
processprocess:attribute
Jan 20, 2022
Merged

🐛 [amp story] Change toggleAttribute to set/removeAttribute#37420
processprocess merged 6 commits intoampproject:mainfrom
processprocess:attribute

Conversation

@processprocess
Copy link
Copy Markdown
Contributor

@processprocess processprocess commented Jan 19, 2022

toggleAttribute is not widely supported so it fails on multiple platforms.

This PR uses the toggleAttribute utility function instead.

Fixes #120, #93

@amp-owners-bot
Copy link
Copy Markdown

amp-owners-bot bot commented Jan 19, 2022

Hey @gmajoulet! These files were changed:

extensions/amp-story-dev-tools/0.1/amp-story-dev-tools-tab-preview.js
extensions/amp-story-dev-tools/0.1/amp-story-dev-tools.js
extensions/amp-story-page-attachment/0.1/amp-story-draggable-drawer.js
extensions/amp-story/1.0/amp-story-embedded-component.js
extensions/amp-story/1.0/pagination-buttons.js

Hey @mszylkowski! These files were changed:

extensions/amp-story-dev-tools/0.1/amp-story-dev-tools-tab-preview.js
extensions/amp-story-dev-tools/0.1/amp-story-dev-tools.js
extensions/amp-story-page-attachment/0.1/amp-story-draggable-drawer.js

Hey @newmuis! These files were changed:

extensions/amp-story-page-attachment/0.1/amp-story-draggable-drawer.js
extensions/amp-story/1.0/amp-story-embedded-component.js
extensions/amp-story/1.0/pagination-buttons.js

'\\.pageXOffset(?!_)': bannedTermsHelpString,
'\\.pageYOffset(?!_)': bannedTermsHelpString,
'\\.innerWidth(?!_)': bannedTermsHelpString,
'\\.toggleAttribute(?!_)': 'please use `toggleAttribute()` from core/dom',
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@jridgewell I feel like we should add this to forbidden terms to prevent future errors. WDYT?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

SGTM.

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.

🚨 Error: i.toggleAttribute is not a function

5 participants