Skip to content

Commit

Permalink
Fix merge conflict around toggleAttribute
Browse files Browse the repository at this point in the history
  • Loading branch information
rictic committed Nov 5, 2018
1 parent 566dcfa commit 419dce6
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions lib/legacy/legacy-element-mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -869,19 +869,23 @@ export const LegacyElementMixin = dedupingMixin((base) => {
* @param {string} name HTML attribute name
* @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
* @override
*/
toggleAttribute(name, bool, node) {
node = /** @type {Element} */ (node || this);
toggleAttribute(name, bool) {
let node = /** @type {Element} */ this;
if (arguments.length === 3) {
node = /** @type {Element} */ arguments[2];
}
if (arguments.length == 1) {
bool = !node.hasAttribute(name);
}
if (bool) {
node.setAttribute(name, '');
return true;
} else {
node.removeAttribute(name);
return false;
}
}

Expand Down

0 comments on commit 419dce6

Please sign in to comment.