File tree Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ test( "custom selector expression", function() {
82
82
} ) ;
83
83
84
84
test ( "jQuery usage" , function ( ) {
85
- expect ( 15 ) ;
85
+ expect ( 16 ) ;
86
86
87
87
var shouldCreate = false ;
88
88
@@ -140,6 +140,9 @@ test( "jQuery usage", function() {
140
140
ret = elem . testWidget ( "jQueryObject" ) ;
141
141
equal ( ret [ 0 ] , document . body , "returned jQuery object" ) ;
142
142
equal ( ret . end ( ) , elem , "stack preserved" ) ;
143
+
144
+ elem . testWidget ( "destroy" ) ;
145
+ equal ( elem . data ( "ui-testWidget" ) , null ) ;
143
146
} ) ;
144
147
145
148
test ( "direct usage" , function ( ) {
Original file line number Diff line number Diff line change @@ -163,9 +163,7 @@ $.widget.bridge = function( name, object ) {
163
163
164
164
if ( isMethodCall ) {
165
165
this . each ( function ( ) {
166
- // 1.9 BC for #7810
167
- // TODO remove fallback to name
168
- var instance = $ . data ( this , fullName ) || $ . data ( this , name ) ;
166
+ var instance = $ . data ( this , fullName ) ;
169
167
if ( ! instance ) {
170
168
return $ . error ( "cannot call methods on " + name + " prior to initialization; " +
171
169
"attempted to call method '" + options + "'" ) ;
@@ -183,9 +181,7 @@ $.widget.bridge = function( name, object ) {
183
181
} ) ;
184
182
} else {
185
183
this . each ( function ( ) {
186
- // 1.9 BC for #7810
187
- // TODO remove fallback to name
188
- var instance = $ . data ( this , fullName ) || $ . data ( this , name ) ;
184
+ var instance = $ . data ( this , fullName ) ;
189
185
if ( instance ) {
190
186
instance . option ( options || { } ) . _init ( ) ;
191
187
} else {
@@ -252,7 +248,7 @@ $.Widget.prototype = {
252
248
// all event bindings should go through this._bind()
253
249
this . element
254
250
. unbind ( "." + this . widgetName )
255
- . removeData ( this . widgetName ) ;
251
+ . removeData ( this . widgetFullName ) ;
256
252
this . widget ( )
257
253
. unbind ( "." + this . widgetName )
258
254
. removeAttr ( "aria-disabled" )
You can’t perform that action at this time.
0 commit comments