X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=src%2Fjquery%2Fjquery.js;h=0aac026206aa795e8561ddb458bc483067f447d7;hb=a5f9108a2109b2ed5778af860b0928d8e6b0fdd2;hp=4a05ee537f68fb89258929a711ce69dff286f313;hpb=609dec9a78ac98e69b67a73989d8437f67c6d33a;p=jquery.git diff --git a/src/jquery/jquery.js b/src/jquery/jquery.js index 4a05ee5..0aac026 100644 --- a/src/jquery/jquery.js +++ b/src/jquery/jquery.js @@ -951,9 +951,9 @@ jQuery.fn = jQuery.prototype = { */ add: function(t) { return this.set( jQuery.merge( - this.get(), typeof t == "string" ? - jQuery.find(t) : - t.constructor == Array ? t : [t] ) ); + this.get(), + typeof t == "string" ? jQuery.find(t) : t ) + ); }, /** @@ -1355,16 +1355,17 @@ jQuery.extend({ var wrap = // option or optgroup - !s.indexOf("", ""] || + !s.indexOf("", ""] || - !s.indexOf("", ""] || !s.indexOf("", ""] || // matched above - !s.indexOf("", ""] || [0,"",""]; @@ -1400,6 +1401,7 @@ jQuery.extend({ r.push( arg ); else r = jQuery.merge( r, arg ); + } return r; @@ -1928,50 +1930,6 @@ jQuery.each({ */ /** - * Displays each of the set of matched elements if they are hidden. - * - * @example $("p").show() - * @before

Hello

- * @result [

Hello

] - * - * @name show - * @type jQuery - * @cat Effects - */ - -/** - * Hides each of the set of matched elements if they are shown. - * - * @example $("p").hide() - * @before

Hello

- * @result [

Hello

] - * - * var pass = true, div = $("div"); - * div.hide().each(function(){ - * if ( this.style.display != "none" ) pass = false; - * }); - * ok( pass, "Hide" ); - * - * @name hide - * @type jQuery - * @cat Effects - */ - -/** - * Toggles each of the set of matched elements. If they are shown, - * toggle makes them hidden. If they are hidden, toggle - * makes them shown. - * - * @example $("p").toggle() - * @before

Hello

Hello Again

- * @result [

Hello

,

Hello Again

] - * - * @name toggle - * @type jQuery - * @cat Effects - */ - -/** * Adds the specified class to each of the set of matched elements. * * @example $("p").addClass("selected") @@ -2054,20 +2012,6 @@ jQuery.each( { jQuery.attr( this, key, "" ); this.removeAttribute( key ); }, - show: function(){ - this.style.display = this.oldblock ? this.oldblock : ""; - if ( jQuery.css(this,"display") == "none" ) - this.style.display = "block"; - }, - hide: function(){ - this.oldblock = this.oldblock || jQuery.css(this,"display"); - if ( this.oldblock == "none" ) - this.oldblock = "block"; - this.style.display = "none"; - }, - toggle: function(){ - jQuery(this)[ jQuery(this).is(":hidden") ? "show" : "hide" ].apply( jQuery(this), arguments ); - }, addClass: function(c){ jQuery.className.add(this,c); },