Commit 80a6a913 authored by John Resig's avatar John Resig

Fixed a problem with multi-namespaced events not targetting the correct functions for execution.

parent 62bd7e68
...@@ -116,7 +116,7 @@ jQuery.event = { ...@@ -116,7 +116,7 @@ jQuery.event = {
// Namespaced event handlers // Namespaced event handlers
var namespace = type.split("."); var namespace = type.split(".");
type = namespace.shift(); type = namespace.shift();
namespace = RegExp(namespace.sort().join(".*\\.") + "(\\.|$)"); namespace = RegExp("(^|\\.)" + namespace.sort().join(".*\\.") + "(\\.|$)");
if ( events[type] ) { if ( events[type] ) {
// remove the given handler for the given type // remove the given handler for the given type
...@@ -249,9 +249,11 @@ jQuery.event = { ...@@ -249,9 +249,11 @@ jQuery.event = {
// Namespaced event handlers // Namespaced event handlers
namespace = event.type.split("."); namespace = event.type.split(".");
event.type = namespace.shift(); event.type = namespace.shift();
namespace = RegExp(namespace.sort().join(".*\\.") + "(\\.|$)");
// Cache this now, all = true means, any handler // Cache this now, all = true means, any handler
all = !namespace && !event.exclusive; all = !namespace.length && !event.exclusive;
namespace = RegExp("(^|\\.)" + namespace.sort().join(".*\\.") + "(\\.|$)");
handlers = ( jQuery.data(this, "events") || {} )[event.type]; handlers = ( jQuery.data(this, "events") || {} )[event.type];
......
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