Commit b84b997e authored by Brandon Aaron's avatar Brandon Aaron

Prevent a single event object from being fixed more than once

parent 77bb2c50
...@@ -268,17 +268,23 @@ jQuery.event = { ...@@ -268,17 +268,23 @@ jQuery.event = {
// Clean up added properties in IE to prevent memory leak // Clean up added properties in IE to prevent memory leak
if (jQuery.browser.msie) if (jQuery.browser.msie)
event.target = event.preventDefault = event.stopPropagation = event.target = event.preventDefault = event.stopPropagation =
event.handler = event.data = null; event.handler = event.data = event[expando] = null;
return val; return val;
}, },
fix: function(event) { fix: function(event) {
if ( event[expando] == true )
return event;
// store a copy of the original event object // store a copy of the original event object
// and clone to set read-only properties // and clone to set read-only properties
var originalEvent = event; var originalEvent = event;
event = jQuery.extend({}, originalEvent); event = jQuery.extend({}, originalEvent);
// Mark it as fixed
event[expando] = true;
// add preventDefault and stopPropagation since // add preventDefault and stopPropagation since
// they will not work on the clone // they will not work on the clone
event.preventDefault = function() { event.preventDefault = function() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment