Skip to content
Permalink
Browse files

Merge branch 'master' of github.com:jquery/jquery into fix-8790-quick…

…-trigger
  • Loading branch information...
dmethvin committed Apr 11, 2011
2 parents a5071d4 + 094c48e commit 7fa6de0ec16df46b90a862778e16c4091198870d
Showing with 29 additions and 0 deletions.
  1. +8 −0 src/event.js
  2. +21 −0 test/unit/event.js
@@ -1049,6 +1049,14 @@ jQuery.each(["live", "die"], function( i, name ) {
return this;
}

if ( name === "die" && !types &&
origSelector && origSelector[0] === "." ) {

context.unbind( origSelector );

return this;
}

if ( data === false || jQuery.isFunction( data ) ) {
fn = data || returnFalse;
data = undefined;
@@ -2022,6 +2022,27 @@ test("delegate with submit", function() {
jQuery(document).undelegate();
});

test("undelegate() with only namespaces", function(){
expect(2);

var $delegate = jQuery("#liveHandlerOrder"),
count = 0;

$delegate.delegate("a", "click.ns", function(e) {
count++;
});

jQuery("a", $delegate).eq(0).trigger("click.ns");

equals( count, 1, "delegated click.ns");

$delegate.undelegate(".ns");

jQuery("a", $delegate).eq(1).trigger("click.ns");

equals( count, 1, "no more .ns after undelegate");
});

test("Non DOM element events", function() {
expect(1);

0 comments on commit 7fa6de0

Please sign in to comment.
You can’t perform that action at this time.