Commit 395f1da7 authored by Dave Methvin's avatar Dave Methvin

Fix #12827. Remove exclusive event semantics from .trigger().

No unit tests were removed in the undoing of this feature. 😭
parent e2cdf527
...@@ -202,7 +202,7 @@ jQuery.event = { ...@@ -202,7 +202,7 @@ jQuery.event = {
} }
// Event object or event type // Event object or event type
var cache, exclusive, i, cur, old, ontype, special, handle, eventPath, bubbleType, var cache, i, cur, old, ontype, special, handle, eventPath, bubbleType,
type = event.type || event, type = event.type || event,
namespaces = event.namespace ? event.namespace.split(".") : []; namespaces = event.namespace ? event.namespace.split(".") : [];
...@@ -211,12 +211,6 @@ jQuery.event = { ...@@ -211,12 +211,6 @@ jQuery.event = {
return; return;
} }
if ( type.indexOf( "!" ) >= 0 ) {
// Exclusive events trigger only for the exact event (no namespaces)
type = type.slice(0, -1);
exclusive = true;
}
if ( type.indexOf( "." ) >= 0 ) { if ( type.indexOf( "." ) >= 0 ) {
// Namespaced trigger; create a regexp to match event type in handle() // Namespaced trigger; create a regexp to match event type in handle()
namespaces = type.split("."); namespaces = type.split(".");
...@@ -240,7 +234,6 @@ jQuery.event = { ...@@ -240,7 +234,6 @@ jQuery.event = {
event.type = type; event.type = type;
event.isTrigger = true; event.isTrigger = true;
event.exclusive = exclusive;
event.namespace = namespaces.join( "." ); event.namespace = namespaces.join( "." );
event.namespace_re = event.namespace? new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)") : null; event.namespace_re = event.namespace? new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)") : null;
ontype = type.indexOf( ":" ) < 0 ? "on" + type : ""; ontype = type.indexOf( ":" ) < 0 ? "on" + type : "";
...@@ -357,7 +350,6 @@ jQuery.event = { ...@@ -357,7 +350,6 @@ jQuery.event = {
handlers = ( (jQuery._data( this, "events" ) || {} )[ event.type ] || []), handlers = ( (jQuery._data( this, "events" ) || {} )[ event.type ] || []),
delegateCount = handlers.delegateCount, delegateCount = handlers.delegateCount,
args = core_slice.call( arguments ), args = core_slice.call( arguments ),
run_all = !event.exclusive && !event.namespace,
special = jQuery.event.special[ event.type ] || {}, special = jQuery.event.special[ event.type ] || {},
handlerQueue = []; handlerQueue = [];
...@@ -413,9 +405,9 @@ jQuery.event = { ...@@ -413,9 +405,9 @@ jQuery.event = {
for ( j = 0; j < matched.matches.length && !event.isImmediatePropagationStopped(); j++ ) { for ( j = 0; j < matched.matches.length && !event.isImmediatePropagationStopped(); j++ ) {
handleObj = matched.matches[ j ]; handleObj = matched.matches[ j ];
// Triggered event must either 1) be non-exclusive and have no namespace, or // Triggered event must either 1) have no namespace, or
// 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace). // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace).
if ( run_all || (!event.namespace && !handleObj.namespace) || event.namespace_re && event.namespace_re.test( handleObj.namespace ) ) { if ( !event.namespace || event.namespace_re && event.namespace_re.test( handleObj.namespace ) ) {
event.data = handleObj.data; event.data = handleObj.data;
event.handleObj = handleObj; event.handleObj = handleObj;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment