Skip to content

Commit

Permalink
Removes unnecessary code to remove data-on* attributes when function …
Browse files Browse the repository at this point in the history
…not found
  • Loading branch information
eduardolundgren committed Jun 7, 2017
1 parent cfd82b7 commit ead53d6
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions packages/metal-incremental-dom/src/render/attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,9 @@ function attachEvent_(component, element, attr, eventName, fn) {
element[handleKey].removeListener();
element[handleKey] = null;
}

element[attr] = fn;
const elementAttrName = `data-on${eventName.toLowerCase()}`;
if (fn) {
element[attr] = fn;
element[handleKey] = delegate(document, eventName, element, fn);
} else {
element.removeAttribute(elementAttrName);
}
}

Expand Down

0 comments on commit ead53d6

Please sign in to comment.