Skip to content

Commit ef1202d

Browse files
committed
Widget: destroy() now calls _destroy() so that widgets don't need to call the base destroy method. Fixes #5056 - Widget factory: Remove need to call base destroy method.
1 parent 68d905d commit ef1202d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

ui/jquery.ui.widget.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,8 @@ $.Widget.prototype = {
141141
_getCreateOptions: function() {
142142
return $.metadata && $.metadata.get( this.element[0] )[ this.widgetName ];
143143
},
144-
_create: function() {},
145-
_init: function() {},
144+
_create: $.noop,
145+
_init: $.noop,
146146

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

154154
destroy: function() {
155+
this._destroy();
155156
this.element
156157
.unbind( "." + this.widgetName )
157158
.removeData( this.widgetName );
@@ -162,6 +163,7 @@ $.Widget.prototype = {
162163
this.widgetBaseClass + "-disabled " +
163164
"ui-state-disabled" );
164165
},
166+
_destroy: $.noop,
165167

166168
widget: function() {
167169
return this.element;

0 commit comments

Comments
 (0)