Skip to content

Commit

Permalink
Fix signature of toggleAttribute to match native version (#5370)
Browse files Browse the repository at this point in the history
* implement native toggleAttribute signature

* jsdoc for legacy return type
  • Loading branch information
43081j authored and TimvdLippe committed Oct 8, 2018
1 parent 96557f7 commit ce85eb9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/legacy/legacy-element-mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,7 @@ export const LegacyElementMixin = dedupingMixin((base) => {
* @param {boolean=} bool Boolean to force the attribute on or off.
* When unspecified, the state of the attribute will be reversed.
* @param {Element=} node Node to target. Defaults to `this`.
* @return {void}
* @return {boolean} true if the attribute now exists
*/
toggleAttribute(name, bool, node) {
node = /** @type {Element} */ (node || this);
Expand All @@ -826,8 +826,10 @@ export const LegacyElementMixin = dedupingMixin((base) => {
}
if (bool) {
node.setAttribute(name, '');
return true;
} else {
node.removeAttribute(name);
return false;
}
}

Expand Down

0 comments on commit ce85eb9

Please sign in to comment.