Skip to content
Permalink
Browse files

Added a fix for triggered events not being cancellable. (You couldn't…

… return false to stop a .submit(), for example.)
  • Loading branch information
jeresig committed Jan 13, 2007
1 parent dfa1a02 commit 79c58b8406128b33080d72059dff66f49d64114c
Showing with 7 additions and 8 deletions.
  1. +7 −8 src/event/event.js
@@ -82,15 +82,14 @@ jQuery.event = {

// Handle triggering a single element
} else if ( element["on" + type] ) {
if ( element[ type ] && element[ type ].constructor == Function )
element[ type ]();
else {
// Pass along a fake event
data.unshift( this.fix({ type: type, target: element }) );
// Pass along a fake event
data.unshift( this.fix({ type: type, target: element }) );

// Trigger the event
element["on" + type].apply( element, data );
}
// Trigger the event
var val = element["on" + type].apply( element, data );

if ( val !== false && element[ type ] && element[ type ].constructor == Function )
element[ type ]();
}
},

0 comments on commit 79c58b8

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