Small tweaks

This commit is contained in:
Sam Potts
2017-11-04 21:19:02 +11:00
parent 069c8093ae
commit d920de2a25
21 changed files with 234 additions and 167 deletions

View File

@ -391,22 +391,6 @@ const utils = {
);
},
// Bind along with custom handler
proxy(element, eventName, customListener, defaultListener, passive, capture) {
utils.on(
element,
eventName,
event => {
if (customListener) {
customListener.apply(element, [event]);
}
defaultListener.apply(element, [event]);
},
passive,
capture
);
},
// Toggle event listener
toggleListener(elements, event, callback, toggle, passive, capture) {
// Bail if no elements
@ -415,7 +399,7 @@ const utils = {
}
// If a nodelist is passed, call itself on each node
if (elements instanceof NodeList) {
if (utils.is.nodeList(elements)) {
// Create listener for each node
Array.from(elements).forEach(element => {
if (element instanceof Node) {