Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
dom.delegate(
document,
triggerEvents[0],
selector,
this.handleToggle.bind(this)
)
);
} else {
this.eventHandler_.add(
dom.delegate(
document,
triggerEvents[0],
selector,
this.handleShow.bind(this)
),
dom.delegate(
document,
triggerEvents[1],
selector,
this.handleHide.bind(this)
)
);
}
}
this.on('mouseenter', this.lock),
this.on('mouseleave', this.unlock)
);
if (triggerEvents[0] === triggerEvents[1]) {
this.eventHandler_.add(
dom.delegate(
document,
triggerEvents[0],
selector,
this.handleToggle.bind(this)
)
);
} else {
this.eventHandler_.add(
dom.delegate(
document,
triggerEvents[0],
selector,
this.handleShow.bind(this)
),
dom.delegate(
document,
triggerEvents[1],
selector,
this.handleHide.bind(this)
)
);
}
}
setLinkSelector(linkSelector) {
this.linkSelector = linkSelector;
if (this.linkEventHandler_) {
this.linkEventHandler_.removeListener();
}
this.linkEventHandler_ = delegate(document, 'click', this.linkSelector, this.onDocClickDelegate_.bind(this), this.allowPreventNavigate);
}
function attachEvent_(component, element, attr, eventName, fn) {
if (isServerSide()) {
return;
}
const handleKey = eventName + HANDLE_SUFFIX;
if (element[handleKey]) {
element[handleKey].removeListener();
element[handleKey] = null;
}
if (fn) {
element[attr] = fn;
element[handleKey] = delegate(document, eventName, element, fn);
}
}
setFormSelector(formSelector) {
this.formSelector = formSelector;
if (this.formEventHandler_) {
this.formEventHandler_.removeListener();
}
this.formEventHandler_ = delegate(document, 'submit', this.formSelector, this.onDocSubmitDelegate_.bind(this), this.allowPreventNavigate);
}