Commit 8b4bd89a authored by Dave Methvin's avatar Dave Methvin Committed by timmywil

Fix bad calls to .undelegate().

Remove two tests that assume "live" data structure.
parent 28c23306
...@@ -371,7 +371,7 @@ test("bind/delegate bubbling, isDefaultPrevented", function() { ...@@ -371,7 +371,7 @@ test("bind/delegate bubbling, isDefaultPrevented", function() {
}); });
fakeClick( $anchor2 ); fakeClick( $anchor2 );
$anchor2.unbind( "click" ); $anchor2.unbind( "click" );
$main.undelegate( "click" ); $main.undelegate( "#foo", "click" );
$anchor2.click(function(e) { $anchor2.click(function(e) {
// Let the default action occur // Let the default action occur
}); });
...@@ -380,7 +380,7 @@ test("bind/delegate bubbling, isDefaultPrevented", function() { ...@@ -380,7 +380,7 @@ test("bind/delegate bubbling, isDefaultPrevented", function() {
}); });
fakeClick( $anchor2 ); fakeClick( $anchor2 );
$anchor2.unbind( "click" ); $anchor2.unbind( "click" );
$main.undelegate( "click" ); $main.undelegate( "#foo", "click" );
}); });
test("bind(), iframes", function() { test("bind(), iframes", function() {
...@@ -1188,7 +1188,7 @@ test("toggle(Function, Function, ...)", function() { ...@@ -1188,7 +1188,7 @@ test("toggle(Function, Function, ...)", function() {
}); });
test(".live()/.die()", function() { test(".live()/.die()", function() {
expect(66); expect(65);
var submit = 0, div = 0, livea = 0, liveb = 0; var submit = 0, div = 0, livea = 0, liveb = 0;
...@@ -1284,9 +1284,6 @@ test(".live()/.die()", function() { ...@@ -1284,9 +1284,6 @@ test(".live()/.die()", function() {
jQuery("body").trigger("click"); jQuery("body").trigger("click");
equals( clicked, 2, "live with a context" ); equals( clicked, 2, "live with a context" );
// Make sure the event is actually stored on the context
ok( jQuery._data(container, "events").live, "live with a context" );
// Test unbinding with a different context // Test unbinding with a different context
jQuery("#foo", container).die("click"); jQuery("#foo", container).die("click");
jQuery("#foo").trigger("click"); jQuery("#foo").trigger("click");
...@@ -1703,7 +1700,6 @@ test("live with special events", function() { ...@@ -1703,7 +1700,6 @@ test("live with special events", function() {
jQuery("#liveSpan1").trigger("foo"); jQuery("#liveSpan1").trigger("foo");
// Run: Handler 1, Default // Run: Handler 1, Default
// TODO: Namespace doesn't trigger default (?)
jQuery("#liveSpan1").trigger("foo.a"); jQuery("#liveSpan1").trigger("foo.a");
// Run: remove // Run: remove
...@@ -1719,7 +1715,7 @@ test("live with special events", function() { ...@@ -1719,7 +1715,7 @@ test("live with special events", function() {
}); });
test(".delegate()/.undelegate()", function() { test(".delegate()/.undelegate()", function() {
expect(65); expect(64);
var submit = 0, div = 0, livea = 0, liveb = 0; var submit = 0, div = 0, livea = 0, liveb = 0;
...@@ -1815,9 +1811,6 @@ test(".delegate()/.undelegate()", function() { ...@@ -1815,9 +1811,6 @@ test(".delegate()/.undelegate()", function() {
jQuery("body").trigger("click"); jQuery("body").trigger("click");
equals( clicked, 2, "delegate with a context" ); equals( clicked, 2, "delegate with a context" );
// Make sure the event is actually stored on the context
ok( jQuery._data(container, "events").live, "delegate with a context" );
// Test unbinding with a different context // Test unbinding with a different context
jQuery("#qunit-fixture").undelegate("#foo", "click"); jQuery("#qunit-fixture").undelegate("#foo", "click");
jQuery("#foo").trigger("click"); jQuery("#foo").trigger("click");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment