mirror of
https://github.com/jquery/jquery.git
synced 2026-04-20 03:01:22 -04:00
live event handlers now receive data from trigger, fixes #4532, thanks nbubna
This commit is contained in:
@@ -490,7 +490,7 @@ test("toggle(Function, Function, ...)", function() {
|
||||
});
|
||||
|
||||
test(".live()/.die()", function() {
|
||||
expect(53);
|
||||
expect(54);
|
||||
|
||||
var submit = 0, div = 0, livea = 0, liveb = 0;
|
||||
|
||||
@@ -583,6 +583,10 @@ test(".live()/.die()", function() {
|
||||
jQuery("#foo").live("click", true, function(e){ equals( e.data, true, "live with event data" ); });
|
||||
jQuery("#foo").trigger("click").die("click");
|
||||
|
||||
// Test binding with trigger data
|
||||
jQuery("#foo").live("click", function(e, data){ equals( data, true, "live with trigger data" ); });
|
||||
jQuery("#foo").trigger("click", true).die("click");
|
||||
|
||||
// Verify that return false prevents default action
|
||||
jQuery("#anchor2").live("click", function(){ return false; });
|
||||
var hash = window.location.hash;
|
||||
|
||||
Reference in New Issue
Block a user