]> source.dussan.org Git - jquery.git/commitdiff
Make sure namespaces is always an array, when passed to the remove special. Follow...
authorjeresig <jeresig@gmail.com>
Thu, 28 Jan 2010 19:16:52 +0000 (14:16 -0500)
committerjeresig <jeresig@gmail.com>
Thu, 28 Jan 2010 19:16:52 +0000 (14:16 -0500)
src/event.js

index 2978bc6a58edd0ff653c0970be57c2fe0b6270b2..53ef72c0c17d2a3733a446152a5a5c87558c5202 100644 (file)
@@ -187,6 +187,9 @@ jQuery.event = {
 
                                                namespace = new RegExp("(^|\\.)" + 
                                                        jQuery.map( namespaces.slice(0).sort(), fcleanup ).join("\\.(?:.*\\.)?") + "(\\.|$)")
+
+                                       } else {
+                                               namespaces = [];
                                        }
 
                                        var special = this.special[ type ] || {};
@@ -208,14 +211,14 @@ jQuery.event = {
                                                }
 
                                                if ( special.remove ) {
-                                                       special.remove.call( elem, namespaces || [], fn);
+                                                       special.remove.call( elem, namespaces, fn);
                                                }
 
                                                // remove generic event handler if no more handlers exist
                                                for ( ret in events[ type ] ) {
-
                                                        break;
                                                }
+
                                                if ( !ret ) {
                                                        if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) {
                                                                if ( elem.removeEventListener ) {