mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
Added a fix for triggered events not being cancellable. (You couldn't return false to stop a .submit(), for example.)
This commit is contained in:
parent
dfa1a0246f
commit
79c58b8406
@ -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 ]();
|
||||
}
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user