Skip to content
Permalink
Browse files

Change destroy to _destroy and remove calls to $.Widget.prototype.des…

…troy in widgets with simple destroy methods.
  • Loading branch information...
scottgonzalez committed Jan 14, 2011
1 parent ef1202d commit 56c4c6aca992e1a441e6a2b498c911cf8d2221a4
@@ -140,7 +140,7 @@ $.widget( "ui.accordion", {
this.element.removeClass( "ui-accordion-icons" );
},

destroy: function() {
_destroy: function() {
var options = this.options;

this.element
@@ -164,8 +164,6 @@ $.widget( "ui.accordion", {
if ( options.heightStyle !== "content" ) {
contents.css( "height", "" );
}

return $.Widget.prototype.destroy.call( this );
},

_setOption: function( key, value ) {
@@ -214,15 +214,14 @@ $.widget( "ui.autocomplete", {
}
},

destroy: function() {
_destroy: function() {
this.element
.removeClass( "ui-autocomplete-input" )
.removeAttr( "autocomplete" )
.removeAttr( "role" )
.removeAttr( "aria-autocomplete" )
.removeAttr( "aria-haspopup" );
this.menu.element.remove();
$.Widget.prototype.destroy.call( this );
},

_setOption: function( key, value ) {
@@ -218,7 +218,7 @@ $.widget( "ui.button", {
return this.buttonElement;
},

destroy: function() {
_destroy: function() {
this.element
.removeClass( "ui-helper-hidden-accessible" );
this.buttonElement
@@ -230,8 +230,6 @@ $.widget( "ui.button", {
if ( !this.hasTitle ) {
this.buttonElement.removeAttr( "title" );
}

$.Widget.prototype.destroy.call( this );
},

_setOption: function( key, value ) {
@@ -179,7 +179,7 @@ $.widget("ui.dialog", {
}
},

destroy: function() {
_destroy: function() {
var self = this;

if ( self.overlay ) {
@@ -195,9 +195,6 @@ $.widget("ui.dialog", {
if ( self.originalTitle ) {
self.element.attr( "title", self.originalTitle );
}

$.Widget.prototype.destroy.call( this );
return self;
},

widget: function() {
@@ -93,9 +93,7 @@ $.widget("ui.menu", {
});
},

destroy: function() {
$.Widget.prototype.destroy.apply( this, arguments );

_destroy: function() {
this.element
.removeClass( "ui-menu ui-widget ui-widget-content ui-corner-all" )
.removeAttr( "tabIndex" )
@@ -38,7 +38,7 @@ $.widget( "ui.progressbar", {
this._refreshValue();
},

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

this.valueDiv.remove();

$.Widget.prototype.destroy.apply( this, arguments );
},

value: function( newValue ) {
@@ -58,9 +58,8 @@ $.widget("ui.tooltip", {
this.options.disabled = true;
},

destroy: function() {
_destroy: function() {
this.tooltip.remove();
$.Widget.prototype.destroy.apply(this, arguments);
},

widget: function() {

0 comments on commit 56c4c6a

Please sign in to comment.
You can’t perform that action at this time.