Skip to content

Commit faf963c

Browse files
committed
Extended placeholder for _bind with usage code and some TODOs
1 parent fd8d5d2 commit faf963c

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

ui/jquery.ui.widget.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,26 @@ $.Widget.prototype = {
210210
// TODO figure out which element to bind to: this.element, if none specified
211211
// TODO append widget namespace to all event names
212212
// TODO set the scope of the callback to the instance (this here)
213+
// TODO extend destroy to unbind all events to elements other then this.element
214+
215+
// usage: bind to this.element
216+
this._bind({
217+
mouseover: function(event) {
218+
this.show(event.currentTarget)
219+
},
220+
mouseout: function(event) {
221+
this.hide(event.currentTarget);
222+
}
223+
});
224+
// usage: bind to a specified element
225+
this._bind(this.element.find(".headers"), {
226+
mouseover: function(event) {
227+
this.show(event.currentTarget)
228+
},
229+
mouseout: function(event) {
230+
this.hide(event.currentTarget);
231+
}
232+
});
213233
},
214234

215235
_trigger: function( type, event, data ) {

0 commit comments

Comments
 (0)