Skip to content

Commit

Permalink
Widget: destroy() now calls _destroy() so that widgets don't need to …
Browse files Browse the repository at this point in the history
…call the base destroy method. Fixes #5056 - Widget factory: Remove need to call base destroy method.
  • Loading branch information
scottgonzalez committed Jan 14, 2011
1 parent 68d905d commit ef1202d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ui/jquery.ui.widget.js
Expand Up @@ -141,8 +141,8 @@ $.Widget.prototype = {
_getCreateOptions: function() {
return $.metadata && $.metadata.get( this.element[0] )[ this.widgetName ];
},
_create: function() {},
_init: function() {},
_create: $.noop,
_init: $.noop,

_super: function( method ) {
return this.base[ method ].apply( this, slice.call( arguments, 1 ) );
Expand All @@ -152,6 +152,7 @@ $.Widget.prototype = {
},

destroy: function() {
this._destroy();
this.element
.unbind( "." + this.widgetName )
.removeData( this.widgetName );
Expand All @@ -162,6 +163,7 @@ $.Widget.prototype = {
this.widgetBaseClass + "-disabled " +
"ui-state-disabled" );
},
_destroy: $.noop,

widget: function() {
return this.element;
Expand Down

0 comments on commit ef1202d

Please sign in to comment.