File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -260,14 +260,17 @@ test( "merge multiple option arguments", function() {
260
260
} ) ;
261
261
262
262
test ( "._getCreateOptions()" , function ( ) {
263
- expect ( 1 ) ;
263
+ expect ( 3 ) ;
264
264
$ . widget ( "ui.testWidget" , {
265
265
options : {
266
266
option1 : "valuex" ,
267
267
option2 : "valuex" ,
268
268
option3 : "value3"
269
269
} ,
270
270
_getCreateOptions : function ( ) {
271
+ strictEqual ( this . window [ 0 ] , window , "this.window is properly defined" ) ;
272
+ strictEqual ( this . document [ 0 ] , document , "this.document is properly defined" ) ;
273
+
271
274
return {
272
275
option1 : "override1" ,
273
276
option2 : "overideX"
Original file line number Diff line number Diff line change @@ -254,10 +254,6 @@ $.Widget.prototype = {
254
254
this . element = $ ( element ) ;
255
255
this . uuid = widget_uuid ++ ;
256
256
this . eventNamespace = "." + this . widgetName + this . uuid ;
257
- this . options = $ . widget . extend ( { } ,
258
- this . options ,
259
- this . _getCreateOptions ( ) ,
260
- options ) ;
261
257
262
258
this . bindings = $ ( ) ;
263
259
this . hoverable = $ ( ) ;
@@ -280,6 +276,11 @@ $.Widget.prototype = {
280
276
this . window = $ ( this . document [ 0 ] . defaultView || this . document [ 0 ] . parentWindow ) ;
281
277
}
282
278
279
+ this . options = $ . widget . extend ( { } ,
280
+ this . options ,
281
+ this . _getCreateOptions ( ) ,
282
+ options ) ;
283
+
283
284
this . _create ( ) ;
284
285
this . _trigger ( "create" , null , this . _getCreateEventData ( ) ) ;
285
286
this . _init ( ) ;
You can’t perform that action at this time.
0 commit comments