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
|
// Handle triggering a single element
|
||||||
} else if ( element["on" + type] ) {
|
} else if ( element["on" + type] ) {
|
||||||
if ( element[ type ] && element[ type ].constructor == Function )
|
// Pass along a fake event
|
||||||
element[ type ]();
|
data.unshift( this.fix({ type: type, target: element }) );
|
||||||
else {
|
|
||||||
// Pass along a fake event
|
|
||||||
data.unshift( this.fix({ type: type, target: element }) );
|
|
||||||
|
|
||||||
// Trigger the event
|
// Trigger the event
|
||||||
element["on" + type].apply( element, data );
|
var val = element["on" + type].apply( element, data );
|
||||||
}
|
|
||||||
|
if ( val !== false && element[ type ] && element[ type ].constructor == Function )
|
||||||
|
element[ type ]();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue