aboutsummaryrefslogtreecommitdiffstats
path: root/ui/jquery.ui.widget.js
diff options
context:
space:
mode:
Diffstat (limited to 'ui/jquery.ui.widget.js')
-rw-r--r--ui/jquery.ui.widget.js9
1 files changed, 3 insertions, 6 deletions
diff --git a/ui/jquery.ui.widget.js b/ui/jquery.ui.widget.js
index 4d786e5c6..dd7992da2 100644
--- a/ui/jquery.ui.widget.js
+++ b/ui/jquery.ui.widget.js
@@ -130,11 +130,7 @@ $.Widget.prototype = {
options );
this.bindings = $();
-
- var self = this;
- this.element.bind( "remove." + this.widgetName, function() {
- self.destroy();
- });
+ this._bind({ remove: "destroy" });
this._create();
this._trigger( "create" );
@@ -233,7 +229,8 @@ $.Widget.prototype = {
if ( instance.options.disabled ) {
return;
}
- return handler.apply( instance, arguments );
+ return ( typeof handler === "string" ? instance[ handler ] : handler )
+ .apply( instance, arguments );
});
});
},