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 = {
134134 } ,
135135 _createWidget : function ( options , element ) {
136136 element = $ ( element || this . defaultElement || this ) [ 0 ] ;
137- $ . data ( element , this . widgetName , this ) ;
138137 this . element = $ ( element ) ;
139138 this . options = $ . extend ( true , { } ,
140139 this . options ,
141140 this . _getCreateOptions ( ) ,
142141 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+ }
149150 this . _create ( ) ;
150151 this . _trigger ( "create" ) ;
151152 this . _init ( ) ;
You can’t perform that action at this time.
0 commit comments