From 247257ebc9678fba708fc8f3f6835a95afaf2074 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jo=CC=88rn=20Zaefferer?= Date: Wed, 8 Jan 2014 18:15:04 +0100 Subject: [PATCH] Menu: Fix var declaration and move regex comment to the right place. Follow-up to a6806ab1 --- ui/jquery.ui.menu.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ui/jquery.ui.menu.js b/ui/jquery.ui.menu.js index f524c448f..8c9f5a9be 100644 --- a/ui/jquery.ui.menu.js +++ b/ui/jquery.ui.menu.js @@ -274,10 +274,10 @@ $.widget( "ui.menu", { }, refresh: function() { - var that = this, + var menus, items, + that = this, icon = this.options.icons.submenu, - submenus = this.element.find( this.options.menus ), - menus, items; + submenus = this.element.find( this.options.menus ); this.element.toggleClass( "ui-menu-icons", !!this.element.find( ".ui-icon" ).length ); @@ -309,7 +309,6 @@ $.widget( "ui.menu", { // Initialize menu-items containing spaces and/or dashes only as dividers items.not( ".ui-menu-item" ).each(function() { var item = $( this ); - // hyphen, em dash, en dash if ( that._isDivider( item ) ) { item.addClass( "ui-widget-content ui-menu-divider" ); } @@ -497,6 +496,8 @@ $.widget( "ui.menu", { }, _isDivider: function( item ) { + + // Match hyphen, em dash, en dash return !/[^\-\u2014\u2013\s]/.test( item.text() ); }, -- 2.39.5