File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -274,10 +274,10 @@ $.widget( "ui.menu", {
274
274
} ,
275
275
276
276
refresh : function ( ) {
277
- var menus ,
278
- items ,
277
+ var that = this ,
279
278
icon = this . options . icons . submenu ,
280
- submenus = this . element . find ( this . options . menus ) ;
279
+ submenus = this . element . find ( this . options . menus ) ,
280
+ menus , items ;
281
281
282
282
this . element . toggleClass ( "ui-menu-icons" , ! ! this . element . find ( ".ui-icon" ) . length ) ;
283
283
@@ -310,7 +310,7 @@ $.widget( "ui.menu", {
310
310
items . not ( ".ui-menu-item" ) . each ( function ( ) {
311
311
var item = $ ( this ) ;
312
312
// hyphen, em dash, en dash
313
- if ( ! / [ ^ \- \u2014 \u2013 \s ] / . test ( item . text ( ) ) ) {
313
+ if ( that . _isDivider ( item ) ) {
314
314
item . addClass ( "ui-widget-content ui-menu-divider" ) ;
315
315
}
316
316
} ) ;
@@ -496,6 +496,10 @@ $.widget( "ui.menu", {
496
496
return ! $ ( event . target ) . closest ( ".ui-menu" ) . length ;
497
497
} ,
498
498
499
+ _isDivider : function ( item ) {
500
+ return ! / [ ^ \- \u2014 \u2013 \s ] / . test ( item . text ( ) ) ;
501
+ } ,
502
+
499
503
collapse : function ( event ) {
500
504
var newItem = this . active &&
501
505
this . active . parent ( ) . closest ( ".ui-menu-item" , this . element ) ;
You can’t perform that action at this time.
0 commit comments