Skip to content
Permalink
Browse files

Fix live mouseenter and mouseleave binding so they can be activated b…

…y triggers. Fixes #6514.
  • Loading branch information...
Brian Brennan timmywil
Brian Brennan authored and timmywil committed Apr 17, 2011
1 parent 230a50f commit 3cb9c1835c0382163b2e94ae626a7ae0d2d0d94f
Showing with 20 additions and 3 deletions.
  1. +1 −1 src/event.js
  2. +19 −2 test/unit/event.js
@@ -1066,7 +1066,7 @@ jQuery.each(["live", "die"], function( i, name ) {

preType = type;

if ( type === "focus" || type === "blur" ) {
if ( type === "focus" || type === "blur" || type === "mouseenter" || type === "mouseleave" ) {
types.push( liveMap[ type ] + namespaces );
type = type + namespaces;

@@ -832,7 +832,7 @@ test("trigger() bubbling", function() {
});

test("trigger(type, [data], [fn])", function() {
expect(14);
expect(16);

var handler = function(event, a, b, c) {
equals( event.type, "click", "check passed data" );
@@ -849,7 +849,24 @@ test("trigger(type, [data], [fn])", function() {
ok( true, "Native call was triggered" );
};

// Triggers handlrs and native

$elem.live('mouseenter', function(){
ok( true, 'Trigger mouseenter bound by live' );
});

$elem.live('mouseleave', function(){
ok( true, 'Trigger mouseleave bound by live' );
});

$elem.trigger('mouseenter');

$elem.trigger('mouseleave');

$elem.die('mouseenter');

$elem.die('mouseleave');

// Triggers handlrs and native
// Trigger 5
$elem.bind("click", handler).trigger("click", [1, "2", "abc"]);

0 comments on commit 3cb9c18

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