Only try to attach events to things that might emit them
This commit is contained in:
parent
c6cfa2fe87
commit
fb89954158
|
@ -264,6 +264,7 @@ UIFragment.prototype.updateEventListeners = function (c, install) {
|
|||
self.currentAnchorNodes.forEach(function (anchorNode) {
|
||||
var uiNode = findInsertionPoint(anchorNode, self.fragmentId);
|
||||
while (uiNode && getBrand(uiNode, self.fragmentId)) {
|
||||
if ('querySelectorAll' in uiNode) {
|
||||
var nodes = uiNode.querySelectorAll(c.selector);
|
||||
for (var i = 0; i < nodes.length; i++) {
|
||||
var n = nodes[i];
|
||||
|
@ -274,6 +275,7 @@ UIFragment.prototype.updateEventListeners = function (c, install) {
|
|||
n.removeEventListener(cleanEventType(c.eventType), handlerClosure);
|
||||
}
|
||||
}
|
||||
}
|
||||
uiNode = uiNode.nextSibling;
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue