Skip to content
Permalink
Browse files

Widget: Added "dynamic" bindings via ._bind() to allow for proxying.

  • Loading branch information
scottgonzalez committed Jan 18, 2011
1 parent 659db70 commit 6072703cd17a04b0de83b337534fd0c12e24aa88
Showing with 5 additions and 8 deletions.
  1. +2 −2 tests/unit/widget/widget_core.js
  2. +3 −6 ui/jquery.ui.widget.js
@@ -412,7 +412,7 @@ test( "_bind to element (default)", function() {
self = this;
this._bind({
keyup: this.keyup,
keydown: this.keydown
keydown: "keydown"
});
},
keyup: function( event ) {
@@ -452,7 +452,7 @@ test( "_bind to descendent", function() {
self = this;
this._bind( this.element.find( "strong" ), {
keyup: this.keyup,
keydown: this.keydown
keydown: "keydown"
});
},
keyup: function( event ) {
@@ -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 );
});
});
},

0 comments on commit 6072703

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