Bug Tracker

Opened 14 years ago

Closed 14 years ago

Last modified 13 years ago

#690 closed bug (fixed)

Extend unbdind and jquery.event.handle to accept event object for unbinding

Reported by: joern Owned by:
Priority: major Milestone: 1.1a
Component: ajax Version: 1.1a
Keywords: Cc:
Blocked by: Blocking:

Description

Test:

test("unbind(event)", function() {
	expect(3);
	var el = $("#firstp");
	el.click(function() {
		ok( true, "Fake normal bind" );
	});
	el.click(function(event) {
		el.unbind(event);
		ok( true, "Fake onebind" );
	});
	el.click().click();
});

Implementation:

Within the for loop in handle:
event.handler = c[j];

Within unbind:
if(type.type && type.target) {
	jQuery.event.remove( this, type.type, type.handler );
} else
	jQuery.event.remove( this, type, fn );

Change History (1)

comment:1 Changed 14 years ago by john

Milestone: 1.1
Resolution: fixed
Status: newclosed
Version: 1.1

I've added this in SVN (rev 775).

Note: See TracTickets for help on using tickets.