diff options
author | John Resig <jeresig@gmail.com> | 2008-12-19 06:49:44 +0000 |
---|---|---|
committer | John Resig <jeresig@gmail.com> | 2008-12-19 06:49:44 +0000 |
commit | 80a6a91347bcda3ce2f19bf0dfb6973bc97c8916 (patch) | |
tree | fbaf590ed707ee29fc9282633b0921b3809e1858 /src/event.js | |
parent | 62bd7e6817a39fcca21abd62f92d787fab210c03 (diff) | |
download | jquery-80a6a91347bcda3ce2f19bf0dfb6973bc97c8916.tar.gz jquery-80a6a91347bcda3ce2f19bf0dfb6973bc97c8916.zip |
Fixed a problem with multi-namespaced events not targetting the correct functions for execution.
Diffstat (limited to 'src/event.js')
-rw-r--r-- | src/event.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/event.js b/src/event.js index 92252a22c..662fc4848 100644 --- a/src/event.js +++ b/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]; |