jquery event: removed the argument dohandlers from $.trigger. Uses another approach.
This commit is contained in:
parent
7138cf0ce0
commit
0a846e5be6
13
src/event.js
13
src/event.js
|
@ -163,7 +163,7 @@ jQuery.event = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
trigger: function( e, data, elem, donative, extra, dohandlers) {
|
trigger: function( e, data, elem, donative, extra) {
|
||||||
// Event object or event type
|
// Event object or event type
|
||||||
var type = e.type || e;
|
var type = e.type || e;
|
||||||
|
|
||||||
|
@ -207,7 +207,6 @@ jQuery.event = {
|
||||||
|
|
||||||
var val, ret, fn = jQuery.isFunction( elem[ type ] );
|
var val, ret, fn = jQuery.isFunction( elem[ type ] );
|
||||||
|
|
||||||
if ( dohandlers !== false ) {
|
|
||||||
// Trigger the event, it is assumed that "handle" is a function
|
// Trigger the event, it is assumed that "handle" is a function
|
||||||
var handle = jQuery.data(elem, "handle");
|
var handle = jQuery.data(elem, "handle");
|
||||||
if ( handle )
|
if ( handle )
|
||||||
|
@ -216,7 +215,6 @@ jQuery.event = {
|
||||||
// Handle triggering native .onfoo handlers (and on links since we don't call .click() for links)
|
// Handle triggering native .onfoo handlers (and on links since we don't call .click() for links)
|
||||||
if ( (!fn || (jQuery.nodeName(elem, 'a') && type == "click")) && elem["on"+type] && elem["on"+type].apply( elem, data ) === false )
|
if ( (!fn || (jQuery.nodeName(elem, 'a') && type == "click")) && elem["on"+type] && elem["on"+type].apply( elem, data ) === false )
|
||||||
val = false;
|
val = false;
|
||||||
}
|
|
||||||
|
|
||||||
if ( donative !== false && val !== false ) {
|
if ( donative !== false && val !== false ) {
|
||||||
var parent = elem.parentNode || elem.ownerDocument;
|
var parent = elem.parentNode || elem.ownerDocument;
|
||||||
|
@ -551,16 +549,15 @@ jQuery.fn.extend({
|
||||||
});
|
});
|
||||||
|
|
||||||
function liveHandler( event ){
|
function liveHandler( event ){
|
||||||
var check = RegExp("(^|\\.)" + event.type + "(\\.|$)"), stop = true;
|
var check = RegExp("(^|\\.)" + event.type + "(\\.|$)"),
|
||||||
|
stop = true;
|
||||||
|
|
||||||
jQuery.each(jQuery.data(this, "events").live || [], function(i, fn){
|
jQuery.each(jQuery.data(this, "events").live || [], function(i, fn){
|
||||||
if ( check.test(fn.type) ) {
|
if ( check.test(fn.type) ) {
|
||||||
var elem = jQuery(event.target).closest(fn.data)[0];
|
var elem = jQuery(event.target).closest(fn.data)[0];
|
||||||
if ( elem ) {
|
if ( elem && fn.call(elem, event, fn.data) === false )
|
||||||
var ret = jQuery.event.trigger( event.type, [event, fn.data], elem, false, fn, false );
|
|
||||||
if ( ret === false )
|
|
||||||
stop = false;
|
stop = false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
});
|
});
|
||||||
return stop;
|
return stop;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue