]> source.dussan.org Git - jquery-ui.git/commitdiff
Menu: Fix var declaration and move regex comment to the right place.
authorJörn Zaefferer <joern.zaefferer@gmail.com>
Wed, 8 Jan 2014 17:15:04 +0000 (18:15 +0100)
committerJörn Zaefferer <joern.zaefferer@gmail.com>
Wed, 8 Jan 2014 17:15:04 +0000 (18:15 +0100)
Follow-up to a6806ab1

ui/jquery.ui.menu.js

index f524c448fdeb65a194be0b5020c285c4a7a45e83..8c9f5a9be93800a8f5efaf085a275146afefb625 100644 (file)
@@ -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() );
        },