});
test( "jQuery usage", function() {
- expect( 11 );
+ expect( 13 );
var shouldCreate = false;
} else {
return this.getterSetterVal;
}
+ },
+ jQueryObject: function() {
+ return $( "body" );
}
});
ret = elem.testWidget( "getterSetterMethod", 30 );
equals( ret, elem, "getter/setter method can be chainable" );
equals( instance.getterSetterVal, 30, "getter/setter can act as setter" );
+ ret = elem.testWidget( "jQueryObject" );
+ equal( ret[ 0 ], document.body, "returned jQuery object" );
+ equal( ret.end(), elem, "stack preserved" );
});
test( "direct usage", function() {
.testWidget( "testEvent" );
});
-test( "._triger() - instance as element", function() {
+test( "._trigger() - instance as element", function() {
expect( 4 );
$.widget( "ui.testWidget", {
defaultElement: null,
}
var methodValue = instance[ options ].apply( instance, args );
if ( methodValue !== instance && methodValue !== undefined ) {
- returnValue = methodValue;
+ returnValue = methodValue.jquery ?
+ returnValue.pushStack( methodValue.get() ) :
+ methodValue;
return false;
}
});