git.asbjorn.biz
/
jquery.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
77bb2c5
)
Prevent a single event object from being fixed more than once
author
Brandon Aaron
<brandon.aaron@gmail.com>
Sun, 27 Apr 2008 23:08:31 +0000
(23:08 +0000)
committer
Brandon Aaron
<brandon.aaron@gmail.com>
Sun, 27 Apr 2008 23:08:31 +0000
(23:08 +0000)
src/event.js
patch
|
blob
|
history
diff --git
a/src/event.js
b/src/event.js
index
75d231c
..
2d9bdc2
100644
(file)
--- a/
src/event.js
+++ b/
src/event.js
@@
-268,17
+268,23
@@
jQuery.event = {
// Clean up added properties in IE to prevent memory leak
if (jQuery.browser.msie)
event.target = event.preventDefault = event.stopPropagation =
// Clean up added properties in IE to prevent memory leak
if (jQuery.browser.msie)
event.target = event.preventDefault = event.stopPropagation =
- event.handler = event.data = null;
+ event.handler = event.data = event[expando] = null;
return val;
},
fix: function(event) {
return val;
},
fix: function(event) {
+ if ( event[expando] == true )
+ return event;
+
// store a copy of the original event object
// and clone to set read-only properties
var originalEvent = event;
event = jQuery.extend({}, originalEvent);
// store a copy of the original event object
// and clone to set read-only properties
var originalEvent = event;
event = jQuery.extend({}, originalEvent);
+ // Mark it as fixed
+ event[expando] = true;
+
// add preventDefault and stopPropagation since
// they will not work on the clone
event.preventDefault = function() {
// add preventDefault and stopPropagation since
// they will not work on the clone
event.preventDefault = function() {