Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
2 changed files
with
14 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -704,7 +704,7 @@ test("bind()/trigger()/unbind() on plain object", function() { | ||
}); | ||
|
||
test("unbind(type)", function() { | ||
expect( 0 ); | ||
expect( 1 ); | ||
|
||
var $elem = jQuery("#firstp"), | ||
message; | ||
@@ -736,6 +736,17 @@ test("unbind(type)", function() { | ||
$elem.bind("error1 error2.test",error) | ||
.unbind() | ||
.trigger("error1").triggerHandler("error2"); | ||
|
||
// Should only unbind the specified function | ||
jQuery( document ).bind( "click", function(){ | ||
ok( true, "called handler after selective removal"); | ||
}); | ||
var func = function(){ }; | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
dmethvin
Author
Member
|
||
jQuery( document ) | ||
.bind( "click", func ) | ||
.unbind( "click", func ) | ||
.click() | ||
.unbind( "click" ); | ||
}); | ||
|
||
test("unbind(eventObject)", function() { | ||
@@ -1111,7 +1122,7 @@ test("jQuery.Event( type, props )", function() { | ||
|
||
// Supports jQuery.Event implementation | ||
equal( event.type, "keydown", "Verify type" ); | ||
|
||
// ensure "type" in props won't clobber the one set by constructor | ||
equal( jQuery.inArray("type", jQuery.event.props), -1, "'type' property not in props (#10375)" ); | ||
|
||
isn't it good idea to add ok(false, "should not be called"); inside the body of func ?