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.

This commit is contained in:
Dave Methvin 2011-02-09 21:25:29 -05:00 committed by Anton M
parent 1ddfdabbb9
commit 12c0e1a692
2 changed files with 28 additions and 9 deletions

View file

@ -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");
});