X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjquery%2Fjquery.js;h=9f6fbd0f70f04c26af0961039fb51dec1f057960;hb=fcc99cd0f5464d8172405ad33b797e74d751b4c6;hp=35a6ceb2b4562373e17ca112910b0e2a98ed0b7d;hpb=98e8ea3186e3b57955e94364c454de40f458ea0a;p=jquery.git diff --git a/src/jquery/jquery.js b/src/jquery/jquery.js index 35a6ceb..9f6fbd0 100644 --- a/src/jquery/jquery.js +++ b/src/jquery/jquery.js @@ -56,7 +56,7 @@ var jQuery = function(a,c) { } // Watch for when an array is passed in - this.get( a.constructor == Array || a.length && !a.nodeType && a[0] != undefined && a[0].nodeType ? + this.get( a.constructor == Array || a.length && a != window && !a.nodeType && a[0] != undefined && a[0].nodeType ? // Assume that it is an array of DOM Elements jQuery.merge( a, [] ) : @@ -944,12 +944,15 @@ jQuery.fn = jQuery.prototype = { * @result $("p").find("span").end() == [

...

] * * @test ok( 'Yahoo' == $('#yahoo').parent().end().text(), 'Check for end' ); + * ok( $('#yahoo').end(), 'Check for end with nothing to end' ); * * @name end * @type jQuery * @cat DOM/Traversing */ end: function() { + if( !(this.stack && this.stack.length) ) + return this; return this.get( this.stack.pop() ); }, @@ -1469,7 +1472,7 @@ jQuery.extend({ if ( p == "height" || p == "width" ) { var old = {}, oHeight, oWidth, d = ["Top","Bottom","Right","Left"]; - for ( var i in d ) { + for ( var i=0; i