Commit 7e03645a authored by Brandon Aaron's avatar Brandon Aaron

Clean up in jQuery.event.add for assigning a handler.guid

parent 970eb0f0
...@@ -13,6 +13,10 @@ jQuery.event = { ...@@ -13,6 +13,10 @@ jQuery.event = {
if ( jQuery.browser.msie && element.setInterval != undefined ) if ( jQuery.browser.msie && element.setInterval != undefined )
element = window; 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 is passed, bind to handler
if( data != undefined ) { if( data != undefined ) {
// Create temporary function pointer to original handler // Create temporary function pointer to original handler
...@@ -31,13 +35,6 @@ jQuery.event = { ...@@ -31,13 +35,6 @@ jQuery.event = {
handler.guid = fn.guid; 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 // Init the element's event structure
if (!element.$events) if (!element.$events)
element.$events = {}; element.$events = {};
......
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