Make sure subclass is a proper subclass not just subclassing the fn methods. Fixes...
[jquery.git] / src / core.js
index 422b688..2e0ece1 100644 (file)
@@ -961,14 +961,16 @@ jQuery.extend({
                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;