From: Brandon Aaron Date: Wed, 23 May 2007 13:51:04 +0000 (+0000) Subject: Clean up in jQuery.event.add for assigning a handler.guid X-Git-Tag: 1.1.3~30 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=7e03645a5534fc582847df6ece72aec516487b47;p=jquery.git Clean up in jQuery.event.add for assigning a handler.guid --- diff --git a/src/event/event.js b/src/event/event.js index b49e1755d..c1dbec606 100644 --- a/src/event/event.js +++ b/src/event/event.js @@ -13,6 +13,10 @@ jQuery.event = { if ( jQuery.browser.msie && element.setInterval != undefined ) element = window; + // Make sure that the function being executed has a unique ID + if ( !handler.guid ) + handler.guid = this.guid++; + // if data is passed, bind to handler if( data != undefined ) { // Create temporary function pointer to original handler @@ -31,13 +35,6 @@ jQuery.event = { handler.guid = fn.guid; } - // Make sure that the function being executed has a unique ID - if ( !handler.guid ) { - handler.guid = this.guid++; - // Don't forget to set guid for the original handler function - if (fn) fn.guid = handler.guid; - } - // Init the element's event structure if (!element.$events) element.$events = {};