mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
Merge branch '8777' of https://github.com/rwldrn/jquery into rwldrn-8777
Conflicts: src/event.js
This commit is contained in:
commit
094c48e0c5
@ -1033,6 +1033,14 @@ jQuery.each(["live", "die"], function( i, name ) {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( name === "die" && !types &&
|
||||||
|
origSelector && origSelector[0] === "." ) {
|
||||||
|
|
||||||
|
context.unbind( origSelector );
|
||||||
|
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
if ( data === false || jQuery.isFunction( data ) ) {
|
if ( data === false || jQuery.isFunction( data ) ) {
|
||||||
fn = data || returnFalse;
|
fn = data || returnFalse;
|
||||||
data = undefined;
|
data = undefined;
|
||||||
|
@ -2022,6 +2022,27 @@ test("delegate with submit", function() {
|
|||||||
jQuery(document).undelegate();
|
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() {
|
test("Non DOM element events", function() {
|
||||||
expect(1);
|
expect(1);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user