From a7ef01c4109cfe303c9995931093c995359a9471 Sat, 9 Mar 2013 12:31:01 +0100 From: hass Date: Sat, 9 Mar 2013 12:30:45 +0100 Subject: [PATCH] Issue #1938044 by hass: Do not expect "ul.menu" and ".box" in navbar diff --git a/core/modules/toolbar/css/toolbar.menu.css b/core/modules/toolbar/css/toolbar.menu.css index c77c4c5..272b3ae 100644 --- a/core/modules/toolbar/css/toolbar.menu.css +++ b/core/modules/toolbar/css/toolbar.menu.css @@ -6,7 +6,7 @@ margin: 0; padding: 0; } -.toolbar .box { +.toolbar .toolbar-box { display: block; line-height: 1em; /* this prevents the value "normal" from being returned as the line-height */ position: relative; @@ -23,7 +23,7 @@ .toolbar .vertical .handle + a { margin-right: 3em; /* LTR */ } -.toolbar .tray .active-trail > .box a, +.toolbar .tray .active-trail > .toolbar-box a, .toolbar .tray a.active { color: #000; font-weight: bold; diff --git a/core/modules/toolbar/js/toolbar.menu.js b/core/modules/toolbar/js/toolbar.menu.js index f05bcb0..f045a44 100644 --- a/core/modules/toolbar/js/toolbar.menu.js +++ b/core/modules/toolbar/js/toolbar.menu.js @@ -48,7 +48,7 @@ * simply toggling its presence. */ function toggleList ($item, switcher) { - var $toggle = $item.find('> .box > .handle'); + var $toggle = $item.find('> .toolbar-box > .handle'); switcher = (typeof switcher !== 'undefined') ? switcher : !$item.hasClass('open'); // Toggle the item open state. $item.toggleClass('open', switcher); @@ -65,8 +65,8 @@ * * Items with sub-elements have a list toggle attached to them. Menu item * links and the corresponding list toggle are wrapped with in a div - * classed with .box. The .box div provides a positioning context for the - * item list toggle. + * classed with .toolbar-box. The .toolbar-box div provides a positioning + * context for the item list toggle. * * @param {jQuery} $menu * The root of the menu to be initialized. @@ -78,14 +78,14 @@ 'text': '' }; // Initialize items and their links. - $menu.find('li > a').wrap('
'); + $menu.find('li > a').wrap('
'); // Add a handle to each list item if it has a menu. $menu.find('li').each(function (index, element) { var $item = $(element); if ($item.find('> ul.menu').length) { - var $box = $item.find('> .box'); + var $box = $item.find('> .toolbar-box'); options.text = Drupal.t('@label', {'@label': $box.find('a').text()}); - $item.find('> .box') + $item.find('> .toolbar-box') .append(Drupal.theme('toolbarMenuItemToggle', options)); } }); @@ -126,7 +126,7 @@ } if (activeItem) { var $activeItem = $menu.find('a[href="' + activeItem + '"]').addClass('active'); - var $activeTrail = $activeItem.parentsUntil('.root', 'li').addClass('active-trail'); + var $activeTrail = $activeItem.parentsUntil('.toolbar-root', 'li').addClass('active-trail'); toggleList($activeTrail, true); } } @@ -137,7 +137,7 @@ return this.each(function (selector) { var $menu = $(this).once('toolbar-menu'); if ($menu.length) { - $menu.addClass('root'); + $menu.addClass('toolbar-root'); initItems($menu); markListLevels($menu); // Restore previous and active states.