Skip to content
Permalink
Browse files

Short-circuit jQuery.event.fix if it has already fixed the current ev…

…ent object.
  • Loading branch information
brandonaaron committed Dec 19, 2007
1 parent b32ec31 commit a7dfbb55d9e4be6bbf096abb0e06e32086476a96
Showing with 7 additions and 0 deletions.
  1. +7 −0 src/event.js
@@ -263,11 +263,18 @@ jQuery.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);

// 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() {

0 comments on commit a7dfbb5

Please sign in to comment.
You can’t perform that action at this time.