We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6309061 commit 03dcdd6Copy full SHA for 03dcdd6
ui/jquery.ui.widget.js
@@ -134,18 +134,19 @@ $.Widget.prototype = {
134
},
135
_createWidget: function( options, element ) {
136
element = $( element || this.defaultElement || this )[ 0 ];
137
- $.data( element, this.widgetName, this );
138
this.element = $( element );
139
this.options = $.extend( true, {},
140
this.options,
141
this._getCreateOptions(),
142
options );
143
-
144
- var self = this;
145
- this.element.bind( "remove." + this.widgetName, function() {
146
- self.destroy();
147
- });
148
+ if (element !== this) {
+ $.data(element, this.widgetName, this);
+
+ var self = this;
+ this.element.bind("remove." + this.widgetName, function(){
+ self.destroy();
+ });
149
+ }
150
this._create();
151
this._trigger( "create" );
152
this._init();
0 commit comments