File tree Expand file tree Collapse file tree 1 file changed +9
-16
lines changed Expand file tree Collapse file tree 1 file changed +9
-16
lines changed Original file line number Diff line number Diff line change @@ -123,22 +123,6 @@ $.widget( "ui.menubar", {
123
123
. attr ( "aria-haspopup" , "true" )
124
124
. wrapInner ( "<span class='ui-button-text'></span>" ) ;
125
125
126
- if ( that . options . autoExpand ) {
127
- input . bind ( "mouseleave.menubar" , function ( event ) {
128
- that . timer = setTimeout ( function ( ) {
129
- that . _close ( ) ;
130
- } , 150 ) ;
131
- } ) ;
132
- menu . bind ( "mouseleave.menubar" , function ( event ) {
133
- that . timer = setTimeout ( function ( ) {
134
- that . _close ( ) ;
135
- } , 150 ) ;
136
- } )
137
- . bind ( "mouseenter.menubar" , function ( event ) {
138
- clearTimeout ( that . timer ) ;
139
- } ) ;
140
- }
141
-
142
126
// TODO review if these options are a good choice, maybe they can be merged
143
127
if ( that . options . menuIcon ) {
144
128
input . addClass ( "ui-state-default" ) . append ( "<span class='ui-button-icon-secondary ui-icon ui-icon-triangle-1-s'></span>" ) ;
@@ -169,6 +153,15 @@ $.widget( "ui.menubar", {
169
153
} , 100 ) ;
170
154
}
171
155
} ) ;
156
+ if ( that . options . autoExpand ) {
157
+ that . _bind ( {
158
+ "mouseleave .ui-menubar-item" : function ( event ) {
159
+ that . timer = setTimeout ( function ( ) {
160
+ that . _close ( ) ;
161
+ } , 150 ) ;
162
+ }
163
+ } ) ;
164
+ }
172
165
} ,
173
166
174
167
_destroy : function ( ) {
You can’t perform that action at this time.
0 commit comments