diff options
author | Dave Methvin <dave.methvin@gmail.com> | 2011-02-09 21:25:29 -0500 |
---|---|---|
committer | Anton M <obhvsbypqghgc@gmail.com> | 2011-02-15 22:08:39 +0100 |
commit | 12c0e1a692aa045e9d3cf166a41748d7f5fe31cc (patch) | |
tree | cc241a4b34037089d930883d7cd0a28bf5ba4400 /test/unit | |
parent | 1ddfdabbb983e2d3bf7f7200a3da5051f274e6fe (diff) | |
download | jquery-12c0e1a692aa045e9d3cf166a41748d7f5fe31cc.tar.gz jquery-12c0e1a692aa045e9d3cf166a41748d7f5fe31cc.zip |
Fixes #7922. Copy the donor event when simulating a bubbling submit in IE so that we don't accidentally stop propagation on it. Remove a bunch of return statements that could also cancel the event. DRY out the liveFired change from #6359 by moving it to the trigger() function.
Diffstat (limited to 'test/unit')
-rw-r--r-- | test/unit/event.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/unit/event.js b/test/unit/event.js index 8d69807e5..6b78a2495 100644 --- a/test/unit/event.js +++ b/test/unit/event.js @@ -1455,6 +1455,8 @@ test("live with change", function(){ }); test("live with submit", function() { + expect(5); + var count1 = 0, count2 = 0; jQuery("#testForm").live("submit", function(ev) { @@ -1471,7 +1473,16 @@ test("live with submit", function() { equals( count1, 1, "Verify form submit." ); equals( count2, 1, "Verify body submit." ); + jQuery("#testForm input[name=sub1]").live("click", function(ev) { + ok( true, "cancelling submit still calls click handler" ); + }); + + jQuery("#testForm input[name=sub1]")[0].click(); + equals( count1, 2, "Verify form submit." ); + equals( count2, 2, "Verify body submit." ); + jQuery("#testForm").die("submit"); + jQuery("#testForm input[name=sub1]").die("click"); jQuery("body").die("submit"); }); |