diff --git a/core/modules/shortcut/shortcut.theme.css b/core/modules/shortcut/shortcut.theme.css index 7d43c69..727289b 100644 --- a/core/modules/shortcut/shortcut.theme.css +++ b/core/modules/shortcut/shortcut.theme.css @@ -10,7 +10,7 @@ background-image: url("images/shortcut.png"); } .icon-shortcut:active:before, -.active .icon-shortcut:before { +.icon-shortcut.active:before { background-image: url("images/shortcut-active.png"); } .toolbar .tray.horizontal.shortcuts .menu { diff --git a/core/modules/toolbar/css/toolbar.base.css b/core/modules/toolbar/css/toolbar.base.css index ffd632c2..cbdf153 100644 --- a/core/modules/toolbar/css/toolbar.base.css +++ b/core/modules/toolbar/css/toolbar.base.css @@ -58,7 +58,7 @@ html.js .toolbar { left: 0; /* LTR */ position: absolute; top: 0; - z-index: 750; + z-index: 1250; width: 100%; } @media only screen { @@ -105,7 +105,8 @@ html.js .toolbar { .toolbar .horizontal { left: 0; /* LTR */ height: 0; - z-index: 750; + /* Set one higher than the contextual links gear. */ + z-index: 1000; } .toolar .tray .lining { position: relative; @@ -168,7 +169,7 @@ html.js .toolbar { } } @media only screen and (min-width: 28.125em) { - .toolbar .horizontal { + .toolbar .tray.horizontal { position: fixed; } } @@ -192,6 +193,11 @@ html.js .toolbar { } @media only screen { .toolbar .tray .toggle-orientation { + display: none; + } +} +@media only screen and (min-width: 16.5em) { + .toolbar .tray .toggle-orientation { display: block; } } diff --git a/core/modules/toolbar/css/toolbar.icons.css b/core/modules/toolbar/css/toolbar.icons.css index 943d77a..7fc06bf 100644 --- a/core/modules/toolbar/css/toolbar.icons.css +++ b/core/modules/toolbar/css/toolbar.icons.css @@ -43,14 +43,14 @@ background-image: url("../images/icon-home.png"); } .icon-home:active:before, -.active .icon-home:before { +.icon-home.active:before { background-image: url("../images/icon-home-active.png"); } .icon-menu:before { background-image: url("../images/icon-menu.png"); } .icon-menu:active:before, -.active .icon-menu:before { +.icon-menu.active:before { background-image: url("../images/icon-menu-active.png"); } diff --git a/core/modules/toolbar/css/toolbar.menu.css b/core/modules/toolbar/css/toolbar.menu.css index 3dd0a1b..c77c4c5 100644 --- a/core/modules/toolbar/css/toolbar.menu.css +++ b/core/modules/toolbar/css/toolbar.menu.css @@ -23,66 +23,49 @@ .toolbar .vertical .handle + a { margin-right: 3em; /* LTR */ } +.toolbar .tray .active-trail > .box a, +.toolbar .tray a.active { + color: #000; + font-weight: bold; +} /** * Items. */ -.toolbar .vertical .menu .menu a { - padding-bottom: 0.6667em; - padding-top: 0.6667em; -} -.toolbar .tray .level-3 a { - color: #303030; -} -.toolbar .tray .level-4 a { - color: #2d2d2d; -} -.toolbar .tray .level-5 a { - color: #2a2a2a; -} -.toolbar .tray .level-6 a { - color: #272727; -} -.toolbar .tray .level-7 a { - color: #2a2a2a; -} -.toolbar .tray .level-8 a { - color: #2d2d2d; -} -.toolbar .tray .level-9 a { - color: #303030; -} .toolbar .level-2 > ul { - background-color: #f5f5f5; - border-color: #cccccc; + background-color: #fafafa; + border-bottom-color: #cccccc; + border-top-color: #e5e5e5; } .toolbar .level-3 > ul { - background-color: #e5e5e5; - border-color: #bbbbbb; + background-color: #f5f5f5; + border-bottom-color: #c5c5c5; + border-top-color: #dddddd; } .toolbar .level-4 > ul { - background-color: #d5d5d5; - border-color: #aaaaaa; + background-color: #eeeeee; + border-bottom-color: #bbbbbb; + border-top-color: #d5d5d5; } .toolbar .level-5 > ul { - background-color: #c5c5c5; - border-color: #999999; + background-color: #e5e5e5; + border-bottom-color: #b5b5b5; + border-top-color: #cccccc; } .toolbar .level-6 > ul { - background-color: #b5b5b5; - border-color: #888888; + background-color: #eeeeee; + border-bottom-color: #aaaaaa; + border-top-color: #c5c5c5; } .toolbar .level-7 > ul { - background-color: #c5c5c5; - border-color: #999999; + background-color: #fafafa; + border-bottom-color: #b5b5b5; + border-top-color: #cccccc; } .toolbar .level-8 > ul { - background-color: #d5d5d5; - border-color: #aaaaaa; -} -.toolbar .level-9 > ul { - background-color: #e5e5e5; - border-color: #bbbbbb; + background-color: #dddddd; + border-bottom-color: #cccccc; + border-top-color: #dddddd; } /** diff --git a/core/modules/toolbar/css/toolbar.theme.css b/core/modules/toolbar/css/toolbar.theme.css index ea54a80..08a573c 100644 --- a/core/modules/toolbar/css/toolbar.theme.css +++ b/core/modules/toolbar/css/toolbar.theme.css @@ -34,6 +34,7 @@ .toolbar .bar a:hover { background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.125) 20%, transparent 200%); background-image: linear-gradient(rgba(255, 255, 255, 0.125) 20%, transparent 200%); + text-decoration: none; } .toolbar .bar a.active { background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.25) 20%, transparent 200%); @@ -41,6 +42,7 @@ } .toolbar .bar a { color: #ffffff; + font-weight: bold; } /** @@ -68,7 +70,12 @@ background-color: #f5f5f5; } .toolbar .tray a { - color: #333333; + color: #707070; +} +.toolbar .tray a:hover, +.toolbar .tray a:active, +.toolbar .tray a.active { + color: #000; } .toolbar .horizontal .menu { background-color: #ffffff; @@ -101,14 +108,11 @@ .toolbar .vertical .menu .menu .menu .menu { margin-left: 0.25em; /* LTR */ } -.toolbar .vertical .menu a { - font-weight: bold; -} -.toolbar .vertical .menu .menu a { - font-weight: normal; +.toolbar .menu .menu a { + color: #434343; } .toolbar .vertical .menu .menu .menu a { - padding-left: 0.5em; /* LTR */ + padding-left: 0.6667em; /* LTR */ } /** diff --git a/core/modules/toolbar/js/toolbar.js b/core/modules/toolbar/js/toolbar.js index 3265ea9..08a68d2 100644 --- a/core/modules/toolbar/js/toolbar.js +++ b/core/modules/toolbar/js/toolbar.js @@ -17,8 +17,8 @@ var activeTab = JSON.parse(localStorage.getItem('Drupal.toolbar.activeTab')); /** * Store the state of the trays to maintain them across page loads. */ -var orientation = JSON.parse(localStorage.getItem('Drupal.toolbar.trayOrientation')) || 'vertical'; -var locked = JSON.parse(localStorage.getItem('Drupal.toolbar.trayLocked')) || false; +var locked = JSON.parse(localStorage.getItem('Drupal.toolbar.trayVerticalLocked')) || false; +var orientation = (locked) ? 'vertical' : 'horizontal'; /** * Holds the jQuery objects of the toolbar DOM element, the trays and messages. @@ -66,20 +66,22 @@ Drupal.behaviors.toolbar = { // Add the tray orientation toggles. .find('.lining') .append(Drupal.theme('toolbarOrientationToggle')); - // Set the active state of the orientation toggles. - changeOrientation(orientation, locked); // Store media queries. mql.standard = window.matchMedia(options.breakpoints['module.toolbar.standard']); // Set up switching between the vertical and horizontal presentation // of the toolbar trays based on a breakpoint. mql.wide = window.matchMedia(options.breakpoints['module.toolbar.wide']); mql.wide.addListener(Drupal.toolbar.mediaQueryChangeHandler); - if (mql.wide.matches) { - Drupal.toolbar.mediaQueryChangeHandler(mql.wide); - } + // Set the orientation of the tray. + // If the tray is set to vertical in localStorage, persist the vertical + // presentation. If the tray is not locked to vertical, let the media + // query application decide the orientation. + changeOrientation((locked) ? 'vertical' : ((mql.wide.matches) ? 'horizontal' : 'vertical'), locked); + // Render the main menu as a nested, collapsible accordion. + $toolbar.find('.administration.tray .toolbar-menu > .menu').toolbarMenu(); // Call setHeight on screen resize. Wrap it in debounce to prevent // setHeight from being called too frequently. - var setHeight = Drupal.debounce(Drupal.toolbar.setHeight, 250); + var setHeight = Drupal.debounce(Drupal.toolbar.setHeight, 200); // Attach behavior to the window. $(window) .on('resize.toolbar', setHeight); @@ -87,15 +89,13 @@ Drupal.behaviors.toolbar = { $toolbar .on('click.toolbar', '.bar a', Drupal.toolbar.toggleTray) .on('click.toolbar', '.toggle-orientation button', Drupal.toolbar.orientationChangeHandler); - // Decorate the main menu with an interactive menu. - $toolbar.find('.administration.tray .toolbar-menu > .menu').toolbarMenu(); // Restore the open tab. Only open the tab on wide screens. if (activeTab && window.matchMedia(options.breakpoints['module.toolbar.standard']).matches) { $toolbar.find('[data-toolbar-tray="' + activeTab + '"]').trigger('click.toolbar'); } - // Recalculate the offset top of the toolbar once on initialization. else { - Drupal.toolbar.setHeight(); + // Update the page and toolbar dimension indicators. + updatePeripherals(); } } }, @@ -110,10 +110,13 @@ Drupal.behaviors.toolbar = { /** * Set subtrees. + * + * JSONP callback. + * @see toolbar_subtrees_jsonp(). */ Drupal.toolbar.setSubtrees = function(subtrees) { Drupal.toolbar.subtrees = subtrees; -} +}; /** * Toggle a toolbar tab and the associated tray. @@ -153,10 +156,8 @@ Drupal.toolbar.toggleTray = function (event) { // Set aria-pressed to false. .attr('aria-pressed', 'false'); $toolbar.find('.tray').not($activateTray).removeClass('active'); - // Adjust the body to accommodate trays. - setBodyState(); - // Adjust the height of the toolbar. - Drupal.toolbar.setHeight(); + // Update the page and toolbar dimension indicators. + updatePeripherals(); } }; @@ -198,14 +199,10 @@ Drupal.toolbar.setHeight = function () { * Respond to configured media query applicability changes. */ Drupal.toolbar.mediaQueryChangeHandler = function (mql) { - if (!locked) { - var orientation = (mql.matches) ? 'horizontal' : 'vertical'; - changeOrientation(orientation); - // Adjust the body to accommodate trays. - setBodyState(); - // Adjust the height of the toolbar. - Drupal.toolbar.setHeight(); - } + var orientation = (mql.matches) ? 'horizontal' : 'vertical'; + changeOrientation(orientation); + // Update the page and toolbar dimension indicators. + updatePeripherals(); }; /** @@ -218,10 +215,8 @@ Drupal.toolbar.orientationChangeHandler = function (event) { var orientation = event.target.value; var $tray = $button.closest('.tray'); changeOrientation(orientation, true); - // Adjust the body to accommodate trays. - setBodyState(); - // Adjust the height of the toolbar. - Drupal.toolbar.setHeight(); + // Update the page and toolbar dimension indicators. + updatePeripherals(); }; /** @@ -239,10 +234,10 @@ function changeOrientation (newOrientation, isLock) { if (isLock) { locked = (newOrientation === 'vertical'); if (locked) { - localStorage.setItem('Drupal.toolbar.trayLocked', JSON.stringify(locked)); + localStorage.setItem('Drupal.toolbar.trayVerticalLocked', JSON.stringify(locked)); } else { - localStorage.removeItem('Drupal.toolbar.trayLocked'); + localStorage.removeItem('Drupal.toolbar.trayVerticalLocked'); } } if ((!locked && newOrientation === 'horizontal') || newOrientation === 'vertical') { @@ -252,8 +247,6 @@ function changeOrientation (newOrientation, isLock) { orientation = newOrientation; toggleOrientationToggle((newOrientation === 'vertical') ? 'horizontal' : 'vertical'); } - // Store the orientation to maintain it across page loads. - localStorage.setItem('Drupal.toolbar.trayOrientation', JSON.stringify(newOrientation)); } /** @@ -291,6 +284,19 @@ function toggleOrientationToggle (orientation) { } /** + * Updates elements peripheral to the toolbar. + * + * When the dimensions and orientation of the toolbar change, elements on the + * page must either be changed or informed of the changes. + */ +function updatePeripherals () { + // Adjust the body to accommodate trays. + setBodyState(); + // Adjust the height of the toolbar. + Drupal.toolbar.setHeight(); +} + +/** * Places the message in the toolbar's ARIA live message area. * * The message will be read by speaking User Agents. @@ -309,9 +315,9 @@ function setMessage (message) { * A string representing a DOM fragment. */ Drupal.theme.toolbarOrientationToggle = function () { - return '