]> source.dussan.org Git - jquery-ui.git/commitdiff
Widget: destroy() now calls _destroy() so that widgets don't need to call the base...
authorScott González <scott.gonzalez@gmail.com>
Fri, 14 Jan 2011 21:55:13 +0000 (16:55 -0500)
committerScott González <scott.gonzalez@gmail.com>
Fri, 14 Jan 2011 21:55:13 +0000 (16:55 -0500)
ui/jquery.ui.widget.js

index 4443674235fba123f6fabc30251f59216cb11364..37c26ab2f28f1a8d57976ec5a785e1defcb85ea3 100644 (file)
@@ -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 ) );
@@ -152,6 +152,7 @@ $.Widget.prototype = {
        },
 
        destroy: function() {
+               this._destroy();
                this.element
                        .unbind( "." + this.widgetName )
                        .removeData( this.widgetName );
@@ -162,6 +163,7 @@ $.Widget.prototype = {
                                this.widgetBaseClass + "-disabled " +
                                "ui-state-disabled" );
        },
+       _destroy: $.noop,
 
        widget: function() {
                return this.element;