});
test( "jQuery usage", function() {
- expect( 15 );
+ expect( 16 );
var shouldCreate = false;
ret = elem.testWidget( "jQueryObject" );
equal( ret[ 0 ], document.body, "returned jQuery object" );
equal( ret.end(), elem, "stack preserved" );
+
+ elem.testWidget( "destroy" );
+ equal( elem.data( "ui-testWidget" ), null );
});
test( "direct usage", function() {
if ( isMethodCall ) {
this.each(function() {
- // 1.9 BC for #7810
- // TODO remove fallback to name
- var instance = $.data( this, fullName ) || $.data( this, name );
+ var instance = $.data( this, fullName );
if ( !instance ) {
return $.error( "cannot call methods on " + name + " prior to initialization; " +
"attempted to call method '" + options + "'" );
});
} else {
this.each(function() {
- // 1.9 BC for #7810
- // TODO remove fallback to name
- var instance = $.data( this, fullName ) || $.data( this, name );
+ var instance = $.data( this, fullName );
if ( instance ) {
instance.option( options || {} )._init();
} else {
// all event bindings should go through this._bind()
this.element
.unbind( "." + this.widgetName )
- .removeData( this.widgetName );
+ .removeData( this.widgetFullName );
this.widget()
.unbind( "." + this.widgetName )
.removeAttr( "aria-disabled" )