Skip to content

Commit 10c9150

Browse files
committed
Merge pull request #54 from meteorhacks/fix-jquery-event-handler-bug
Use a dictionary of event handlers
2 parents 8ba5b2b + f62b48b commit 10c9150

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

assets/zone.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -328,13 +328,16 @@ Zone.patchEventTargetMethods = function (obj, thing) {
328328
});
329329
}
330330

331-
arguments[1] = fn._bound = zone.bind(fn, false, ownerInfo);
331+
fn._bound = fn._bound || {};
332+
arguments[1] = fn._bound[eventName] = zone.bind(fn, false, ownerInfo);
332333
return Zone._apply(addDelegate, this, arguments);
333334
};
334335

335336
var removeDelegate = obj.removeEventListener;
336337
obj.removeEventListener = function (eventName, fn) {
337-
arguments[1] = arguments[1]._bound || arguments[1];
338+
if(arguments[1]._bound && arguments[1]._bound[eventName]) {
339+
arguments[1] = arguments[1]._bound[eventName];
340+
}
338341
var result = Zone._apply(removeDelegate, this, arguments);
339342
zone.dequeueTask(fn);
340343
return result;

0 commit comments

Comments
 (0)