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 (parent:
b32ec31
)
Short-circuit jQuery.event.fix if it has already fixed the current event object.
author
Brandon Aaron
<brandon.aaron@gmail.com>
Wed, 19 Dec 2007 18:35:58 +0000
(18:35 +0000)
committer
Brandon Aaron
<brandon.aaron@gmail.com>
Wed, 19 Dec 2007 18:35:58 +0000
(18:35 +0000)
src/event.js
patch
|
blob
|
history
diff --git
a/src/event.js
b/src/event.js
index
c0238cc
..
fa8be8d
100644
(file)
--- a/
src/event.js
+++ b/
src/event.js
@@
-263,11
+263,18
@@
jQuery.event = {
},
fix: function(event) {
},
fix: function(event) {
+ // Short-circuit if the event has already been fixed by jQuery.event.fix
+ if ( event[ expando ] )
+ 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 the event as fixed by jQuery.event.fix
+ 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() {