Skip to content

Commit 56c4c6a

Browse files
committed
Change destroy to _destroy and remove calls to $.Widget.prototype.destroy in widgets with simple destroy methods.
1 parent ef1202d commit 56c4c6a

7 files changed

+7
-20
lines changed

ui/jquery.ui.accordion.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ $.widget( "ui.accordion", {
140140
this.element.removeClass( "ui-accordion-icons" );
141141
},
142142

143-
destroy: function() {
143+
_destroy: function() {
144144
var options = this.options;
145145

146146
this.element
@@ -164,8 +164,6 @@ $.widget( "ui.accordion", {
164164
if ( options.heightStyle !== "content" ) {
165165
contents.css( "height", "" );
166166
}
167-
168-
return $.Widget.prototype.destroy.call( this );
169167
},
170168

171169
_setOption: function( key, value ) {

ui/jquery.ui.autocomplete.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -214,15 +214,14 @@ $.widget( "ui.autocomplete", {
214214
}
215215
},
216216

217-
destroy: function() {
217+
_destroy: function() {
218218
this.element
219219
.removeClass( "ui-autocomplete-input" )
220220
.removeAttr( "autocomplete" )
221221
.removeAttr( "role" )
222222
.removeAttr( "aria-autocomplete" )
223223
.removeAttr( "aria-haspopup" );
224224
this.menu.element.remove();
225-
$.Widget.prototype.destroy.call( this );
226225
},
227226

228227
_setOption: function( key, value ) {

ui/jquery.ui.button.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ $.widget( "ui.button", {
218218
return this.buttonElement;
219219
},
220220

221-
destroy: function() {
221+
_destroy: function() {
222222
this.element
223223
.removeClass( "ui-helper-hidden-accessible" );
224224
this.buttonElement
@@ -230,8 +230,6 @@ $.widget( "ui.button", {
230230
if ( !this.hasTitle ) {
231231
this.buttonElement.removeAttr( "title" );
232232
}
233-
234-
$.Widget.prototype.destroy.call( this );
235233
},
236234

237235
_setOption: function( key, value ) {

ui/jquery.ui.dialog.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ $.widget("ui.dialog", {
179179
}
180180
},
181181

182-
destroy: function() {
182+
_destroy: function() {
183183
var self = this;
184184

185185
if ( self.overlay ) {
@@ -195,9 +195,6 @@ $.widget("ui.dialog", {
195195
if ( self.originalTitle ) {
196196
self.element.attr( "title", self.originalTitle );
197197
}
198-
199-
$.Widget.prototype.destroy.call( this );
200-
return self;
201198
},
202199

203200
widget: function() {

ui/jquery.ui.menu.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,7 @@ $.widget("ui.menu", {
9393
});
9494
},
9595

96-
destroy: function() {
97-
$.Widget.prototype.destroy.apply( this, arguments );
98-
96+
_destroy: function() {
9997
this.element
10098
.removeClass( "ui-menu ui-widget ui-widget-content ui-corner-all" )
10199
.removeAttr( "tabIndex" )

ui/jquery.ui.progressbar.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ $.widget( "ui.progressbar", {
3838
this._refreshValue();
3939
},
4040

41-
destroy: function() {
41+
_destroy: function() {
4242
this.element
4343
.removeClass( "ui-progressbar ui-widget ui-widget-content ui-corner-all" )
4444
.removeAttr( "role" )
@@ -47,8 +47,6 @@ $.widget( "ui.progressbar", {
4747
.removeAttr( "aria-valuenow" );
4848

4949
this.valueDiv.remove();
50-
51-
$.Widget.prototype.destroy.apply( this, arguments );
5250
},
5351

5452
value: function( newValue ) {

ui/jquery.ui.tooltip.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,8 @@ $.widget("ui.tooltip", {
5858
this.options.disabled = true;
5959
},
6060

61-
destroy: function() {
61+
_destroy: function() {
6262
this.tooltip.remove();
63-
$.Widget.prototype.destroy.apply(this, arguments);
6463
},
6564

6665
widget: function() {

0 commit comments

Comments
 (0)