data = undefined;
}
- types = types.split( /\s+/ );
+ types = (types || "").split( /\s+/ );
- while ( (type = types[ i++ ]) ) {
+ while ( (type = types[ i++ ]) != null ) {
type = type === "focus" ? "focusin" : // focus --> focusin
type === "blur" ? "focusout" : // blur --> focusout
type === "hover" ? types.push("mouseleave") && "mouseenter" : // hover support
}
function liveConvert( type, selector ) {
- return ["live", type, selector.replace(/\./g, "`").replace(/ /g, "&")].join(".");
+ return "live." + (type ? type + "." : "") + selector.replace(/\./g, "`").replace(/ /g, "&");
}
jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
jQuery("#nothiddendiv div").die("click");
});
+test("die all bound events", function(){
+ expect(1);
+
+ var count = 0;
+ var div = jQuery("div#nothiddendivchild");
+
+ div.live("click submit", function(){ count++; });
+ div.die();
+
+ div.trigger("click");
+ div.trigger("submit");
+
+ equals( count, 0, "Make sure no events were triggered." );
+});
+
test("live with multiple events", function(){
expect(1);
var count = 0;
- var div = jQuery("div#nothiddendivchild")
+ var div = jQuery("div#nothiddendivchild");
div.live("click submit", function(){ count++; });