refactor specialAll into add and remove hooks for existing special events, live now accepts optional data param like bind, fixes #4612 and #4613, thanks to Mike Helgeson

This commit is contained in:
Brandon Aaron 2009-04-30 21:44:25 +00:00
parent 287ecdbf67
commit 71efbdd3b2
2 changed files with 37 additions and 41 deletions

View file

@ -490,7 +490,7 @@ test("toggle(Function, Function, ...)", function() {
});
test(".live()/.die()", function() {
expect(52);
expect(53);
var submit = 0, div = 0, livea = 0, liveb = 0;
@ -579,6 +579,9 @@ test(".live()/.die()", function() {
jQuery("#foo").trigger('click');
equals( clicked, 2, "die with a context");
// Test binding with event data
jQuery("#foo").live("click", true, function(e){ equals( e.data, true, "live with event data" ); });
jQuery("#foo").trigger("click").die("click");
// Verify that return false prevents default action
jQuery("#anchor2").live("click", function(){ return false; });