Skip to content
Permalink
Browse files
Triggered event handlers are only executed once now.
  • Loading branch information
jeresig committed Jan 22, 2007
1 parent b81ea5f commit 6c72f188cd8a7f98a10904b754eb4495f46af503
Showing with 10 additions and 2 deletions.
  1. +10 −2 src/event/event.js
@@ -87,13 +87,21 @@ jQuery.event = {
// Trigger the event
var val = element["on" + type].apply( element, data );

if ( val !== false && jQuery.isFunction( element[ type ] ) )
if ( val !== false && jQuery.isFunction( element[ type ] ) ) {
this.triggered = true;
element[ type ]();
}
}
},

handle: function(event) {
if ( typeof jQuery == "undefined" ) return false;
if ( typeof jQuery == "undefined" ) return;

// Handle the second event of a trigger
if ( jQuery.event.triggered ) {
jQuery.event.triggered = false;
return;
}

// Empty object is for triggered events with no data
event = jQuery.event.fix( event || window.event || {} );

0 comments on commit 6c72f18

Please sign in to comment.