aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAriel Flesler <aflesler@gmail.com>2008-12-30 23:29:14 +0000
committerAriel Flesler <aflesler@gmail.com>2008-12-30 23:29:14 +0000
commit0a846e5be6e74d97c191379b3bc69c93125144ee (patch)
treefd8cb59bf1845946e423366565953cdfd72777da /src
parent7138cf0ce04b4ee1834c0aaa9d5e435f6eac882f (diff)
downloadjquery-0a846e5be6e74d97c191379b3bc69c93125144ee.tar.gz
jquery-0a846e5be6e74d97c191379b3bc69c93125144ee.zip
jquery event: removed the argument dohandlers from $.trigger. Uses another approach.
Diffstat (limited to 'src')
-rw-r--r--src/event.js29
1 files changed, 13 insertions, 16 deletions
diff --git a/src/event.js b/src/event.js
index 0710b7bfa..f2b01fef6 100644
--- a/src/event.js
+++ b/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
var type = e.type || e;
@@ -207,16 +207,14 @@ jQuery.event = {
var val, ret, fn = jQuery.isFunction( elem[ type ] );
- if ( dohandlers !== false ) {
- // Trigger the event, it is assumed that "handle" is a function
- var handle = jQuery.data(elem, "handle");
- if ( handle )
- val = handle.apply( elem, data );
+ // Trigger the event, it is assumed that "handle" is a function
+ var handle = jQuery.data(elem, "handle");
+ if ( handle )
+ val = handle.apply( elem, data );
- // 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 )
- val = false;
- }
+ // 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 )
+ val = false;
if ( donative !== false && val !== false ) {
var parent = elem.parentNode || elem.ownerDocument;
@@ -551,15 +549,14 @@ jQuery.fn.extend({
});
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){
if ( check.test(fn.type) ) {
var elem = jQuery(event.target).closest(fn.data)[0];
- if ( elem ) {
- var ret = jQuery.event.trigger( event.type, [event, fn.data], elem, false, fn, false );
- if ( ret === false )
- stop = false;
- }
+ if ( elem && fn.call(elem, event, fn.data) === false )
+ stop = false;
}
});
return stop;