Skip to content
Permalink
Browse files

Shorten up the code and do event cleanup on test cases.

  • Loading branch information...
dmethvin committed Apr 6, 2011
1 parent b5c7c50 commit c1316a4cb1fa9b9f85ef96f0e2ce45768ccd59cd
Showing with 5 additions and 8 deletions.
  1. +3 −8 src/event.js
  2. +2 −0 test/unit/event.js
@@ -1027,15 +1027,10 @@ jQuery.each(["live", "die"], function( i, name ) {
return this;
}

if ( jQuery.isFunction( data ) || data === false ) {
fn = data;
if ( data === false || jQuery.isFunction( data ) ) {
fn = data || returnFalse;
data = undefined;
}

if ( fn === false ) {
fn = returnFalse;
}

}

types = (types || "").split(" ");

@@ -567,6 +567,7 @@ test("live(name, false), die(name, false)", function() {
jQuery("#ap").die("click", false);
jQuery("#ap").trigger("click");
equals( main, 1, "Verify that the trigger happened correctly." );
jQuery("#main").die("click");
});

test("delegate(selector, name, false), undelegate(selector, name, false)", function() {
@@ -587,6 +588,7 @@ test("delegate(selector, name, false), undelegate(selector, name, false)", funct
jQuery("#ap").undelegate("#groups", "click", false);
jQuery("#groups").trigger("click");
equals( main, 1, "Verify that the trigger happened correctly." );
jQuery("#main").undelegate("#ap", "click");
});

test("bind()/trigger()/unbind() on plain object", function() {

0 comments on commit c1316a4

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