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() {
260260} ) ;
261261
262262test ( "._getCreateOptions()" , function ( ) {
263- expect ( 1 ) ;
263+ expect ( 3 ) ;
264264 $ . widget ( "ui.testWidget" , {
265265 options : {
266266 option1 : "valuex" ,
267267 option2 : "valuex" ,
268268 option3 : "value3"
269269 } ,
270270 _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+
271274 return {
272275 option1 : "override1" ,
273276 option2 : "overideX"
Original file line number Diff line number Diff line change @@ -254,10 +254,6 @@ $.Widget.prototype = {
254254 this . element = $ ( element ) ;
255255 this . uuid = widget_uuid ++ ;
256256 this . eventNamespace = "." + this . widgetName + this . uuid ;
257- this . options = $ . widget . extend ( { } ,
258- this . options ,
259- this . _getCreateOptions ( ) ,
260- options ) ;
261257
262258 this . bindings = $ ( ) ;
263259 this . hoverable = $ ( ) ;
@@ -280,6 +276,11 @@ $.Widget.prototype = {
280276 this . window = $ ( this . document [ 0 ] . defaultView || this . document [ 0 ] . parentWindow ) ;
281277 }
282278
279+ this . options = $ . widget . extend ( { } ,
280+ this . options ,
281+ this . _getCreateOptions ( ) ,
282+ options ) ;
283+
283284 this . _create ( ) ;
284285 this . _trigger ( "create" , null , this . _getCreateEventData ( ) ) ;
285286 this . _init ( ) ;
You can’t perform that action at this time.
0 commit comments