X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fcore.js;h=faf205ccc487edea677c6e701df582aa93acc048;hb=749d41f7de7f83f0096e76ed8bf5f78cbc972e03;hp=43d46e9e2f99546a16ee253a688a6c92e21d2025;hpb=8d050558d3dc2c0abd0bde4bc9d03bfb66974689;p=jquery.git diff --git a/src/core.js b/src/core.js index 43d46e9..faf205c 100644 --- a/src/core.js +++ b/src/core.js @@ -929,10 +929,9 @@ jQuery.extend({ if ( length > 1 ) { resolveArray = new Array( length ); - jQuery.each( args, function( index, element, args ) { + jQuery.each( args, function( index, element ) { jQuery.when( element ).then( function( value ) { - args = arguments; - resolveArray[ index ] = args.length > 1 ? slice.call( args, 0 ) : value; + resolveArray[ index ] = arguments.length > 1 ? slice.call( arguments, 0 ) : value; if( ! --length ) { deferred.resolveWith( promise, resolveArray ); } @@ -958,18 +957,20 @@ jQuery.extend({ return { browser: match[1] || "", version: match[2] || "0" }; }, - subclass: function(){ + sub: function() { function jQuerySubclass( selector, context ) { return new jQuerySubclass.fn.init( selector, context ); } + jQuery.extend( true, jQuerySubclass, this ); jQuerySubclass.superclass = this; jQuerySubclass.fn = jQuerySubclass.prototype = this(); jQuerySubclass.fn.constructor = jQuerySubclass; jQuerySubclass.subclass = this.subclass; jQuerySubclass.fn.init = function init( selector, context ) { - if (context && context instanceof jQuery && !(context instanceof jQuerySubclass)){ + if ( context && context instanceof jQuery && !(context instanceof jQuerySubclass) ) { context = jQuerySubclass(context); } + return jQuery.fn.init.call( this, selector, context, rootjQuerySubclass ); }; jQuerySubclass.fn.init.prototype = jQuerySubclass.fn;