File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -134,18 +134,19 @@ $.Widget.prototype = {
134
134
} ,
135
135
_createWidget : function ( options , element ) {
136
136
element = $ ( element || this . defaultElement || this ) [ 0 ] ;
137
- $ . data ( element , this . widgetName , this ) ;
138
137
this . element = $ ( element ) ;
139
138
this . options = $ . extend ( true , { } ,
140
139
this . options ,
141
140
this . _getCreateOptions ( ) ,
142
141
options ) ;
143
-
144
- var self = this ;
145
- this . element . bind ( "remove." + this . widgetName , function ( ) {
146
- self . destroy ( ) ;
147
- } ) ;
148
-
142
+ if ( element !== this ) {
143
+ $ . data ( element , this . widgetName , this ) ;
144
+
145
+ var self = this ;
146
+ this . element . bind ( "remove." + this . widgetName , function ( ) {
147
+ self . destroy ( ) ;
148
+ } ) ;
149
+ }
149
150
this . _create ( ) ;
150
151
this . _trigger ( "create" ) ;
151
152
this . _init ( ) ;
You can’t perform that action at this time.
0 commit comments