Skip to content

Commit 82d0056

Browse files
author
Steven G. Harms
committed
Convert from bind() to _on()
Per comment from @scottgonzalez
1 parent 0f33062 commit 82d0056

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

ui/jquery.ui.menubar.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,13 @@ $.widget( "ui.menubar", {
137137
input.removeClass( "ui-button-text-only" ).addClass( "ui-button-text-icon-secondary" );
138138
}
139139
} else {
140-
// TODO use _on
141-
input.bind( "click mouseenter", function( event ) {
142-
if ( ( that.open && event.type === "mouseenter" ) || event.type === "click" ) {
143-
that._close();
140+
that._on( input, {
141+
click: function( event ) {
142+
if ( that.open ){ that._close(); }
143+
},
144+
145+
mouseenter: function( event ) {
146+
if ( that.open ){ that._close(); }
144147
}
145148
});
146149
}

0 commit comments

Comments
 (0)