Allow setup event listeners to be set up as separate event listeners

rather than in-conjunction with defaultListener

This allows the setup listeners to do things like
preventDefault()/stopImmediatePropagation() and have them work
This commit is contained in:
Guru Prasad Srinivasa 2017-11-01 04:15:01 -04:00
parent b3759e966d
commit 95734cf7cc

View File

@ -472,13 +472,21 @@
// Bind along with custom handler
function _proxyListener(element, eventName, userListener, defaultListener, useCapture) {
if(userListener) {
// Register this before defaultListener
_on(
element,
eventName,
function(event) {
if (userListener) {
userListener.apply(element, [event]);
},
useCapture
);
}
_on(
element,
eventName,
function(event) {
defaultListener.apply(element, [event]);
},
useCapture