]> source.dussan.org Git - jquery.git/commitdiff
Cleaned up mouseenter and mouseleave special events
authorBrandon Aaron <brandon.aaron@gmail.com>
Sun, 16 Dec 2007 22:18:35 +0000 (22:18 +0000)
committerBrandon Aaron <brandon.aaron@gmail.com>
Sun, 16 Dec 2007 22:18:35 +0000 (22:18 +0000)
src/event.js

index 0ccbf5d31e913122b456fad3612649d670d2294e..007eb1c80bfe9abdf3d2cbc2f450f88e8a35b8f6 100644 (file)
@@ -366,53 +366,45 @@ jQuery.event = {
                
                mouseenter: {
                        setup: function() {
-                               if (jQuery.browser.msie) return false;
-                               jQuery(this).bind('mouseover', jQuery.event.special.mouseenter.handler);
+                               if ( jQuery.browser.msie ) return false;
+                               jQuery(this).bind("mouseover", jQuery.event.special.mouseenter.handler);
                                return true;
                        },
                
                        teardown: function() {
-                               if (jQuery.browser.msie) return false;
-                               jQuery(this).unbind('mouseover', jQuery.event.special.mouseenter.handler);
+                               if ( jQuery.browser.msie ) return false;
+                               jQuery(this).unbind("mouseover", jQuery.event.special.mouseenter.handler);
                                return true;
                        },
                        
                        handler: function(event) {
-                               var args = Array.prototype.slice.call( arguments, 1 );
                                // If we actually just moused on to a sub-element, ignore it
                                if ( withinElement(event, this) ) return true;
                                // Execute the right handlers by setting the event type to mouseenter
-                               event.type = 'mouseenter';
-                               // Include the event object as the first argument
-                               args.unshift(event);
-                               var val = jQuery.event.handle.apply(this, args);
-                               return val;
+                               arguments[0].type = "mouseenter";
+                               return jQuery.event.handle.apply(this, arguments);
                        }
                },
        
                mouseleave: {
                        setup: function() {
-                               if (jQuery.browser.msie) return false;
-                               jQuery(this).bind('mouseout', jQuery.event.special.mouseleave.handler);
+                               if ( jQuery.browser.msie ) return false;
+                               jQuery(this).bind("mouseout", jQuery.event.special.mouseleave.handler);
                                return true;
                        },
                
                        teardown: function() {
-                               if (jQuery.browser.msie) return false;
-                               jQuery(this).unbind('mouseout', jQuery.event.special.mouseleave.handler);
+                               if ( jQuery.browser.msie ) return false;
+                               jQuery(this).unbind("mouseout", jQuery.event.special.mouseleave.handler);
                                return true;
                        },
                        
                        handler: function(event) {
-                               var args = Array.prototype.slice.call( arguments, 1 );
                                // If we actually just moused on to a sub-element, ignore it
                                if ( withinElement(event, this) ) return true;
                                // Execute the right handlers by setting the event type to mouseleave
-                               event.type = 'mouseleave';
-                               // Include the event object as the first argument
-                               args.unshift(event);
-                               var val = jQuery.event.handle.apply(this, args);
-                               return val;
+                               arguments[0].type = "mouseleave";
+                               return jQuery.event.handle.apply(this, arguments);
                        }
                }
        }