Skip to content
Permalink
Browse files

Fixed a problem with multi-namespaced events not targetting the corre…

…ct functions for execution.
  • Loading branch information
jeresig committed Dec 19, 2008
1 parent 62bd7e6 commit 80a6a91347bcda3ce2f19bf0dfb6973bc97c8916
Showing with 5 additions and 3 deletions.
  1. +5 −3 src/event.js
@@ -116,7 +116,7 @@ jQuery.event = {
// Namespaced event handlers
var namespace = type.split(".");
type = namespace.shift();
namespace = RegExp(namespace.sort().join(".*\\.") + "(\\.|$)");
namespace = RegExp("(^|\\.)" + namespace.sort().join(".*\\.") + "(\\.|$)");

if ( events[type] ) {
// remove the given handler for the given type
@@ -249,9 +249,11 @@ jQuery.event = {
// Namespaced event handlers
namespace = event.type.split(".");
event.type = namespace.shift();
namespace = RegExp(namespace.sort().join(".*\\.") + "(\\.|$)");

// 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];

0 comments on commit 80a6a91

Please sign in to comment.
You can’t perform that action at this time.