diff --git misc/cog-select.png misc/cog-select.png new file mode 100644 index 0000000..8ed4149 Binary files /dev/null and misc/cog-select.png differ diff --git misc/contextual_links.css misc/contextual_links.css index dd2f05a..948f2b1 100644 --- misc/contextual_links.css +++ misc/contextual_links.css @@ -8,31 +8,75 @@ position: relative; } .contextual-links-region-active { - outline: #000 dashed 1px; + outline: #999 dashed 1px; } /** * Contextual links. */ -ul.contextual-links { - float: right; +div.contextual-links-wrapper { + display: none; font-size: 90%; + position: absolute; + right: 5px; + top: 0px; + z-index: 999; +} +html.js div.contextual-links-wrapper { + display: block; +} +a.contextual-links-trigger { + background: transparent url(cog-select.png) no-repeat center center; + display: none; + height: 20px; + outline: none; + text-indent: -999em; + width: 30px; +} +div.contextual-links-wrapper-active a.contextual-links-trigger { + -moz-border-radius: 8px 8px 0 0; + -webkit-border-top-left-radius: 8px; + -webkit-border-top-right-radius: 8px; + border-radius: 8px 8px 0 0; +} +div.contextual-links-wrapper-active a.contextual-links-trigger { + background-color: #666; +} +div.contextual-links-wrapper ul.contextual-links { + background: #666 none; + -moz-border-radius: 8px 0 8px 8px; + -webkit-border-bottom-left-radius: 8px; + -webkit-border-bottom-right-radius: 8px; + -webkit-border-top-left-radius: 8px; + border-radius: 8px 0 8px 8px; + display: none; margin: 0; - padding: 0; + padding: 5px 10px; + position: absolute; + right: 0; + top: 19px; + white-space: nowrap; +} +.contextual-links-region:hover a.contextual-links-trigger, +div.contextual-links-wrapper-active a.contextual-links-trigger, +div.contextual-links-wrapper-active ul.contextual-links { + display: block; } ul.contextual-links li { - border-left: 1px solid #ccc; - display: inline; line-height: 100%; list-style: none; - margin: 0 0 0 0.3em; - padding: 0 0 0 0.6em; -} -ul.contextual-links li.first { - border-left: 0; + list-style-image: none; margin: 0; padding: 0; } -ul.contextual-links li a { +div.contextual-links-wrapper a { text-decoration: none; } +ul.contextual-links li a { + color: #fff; + display: block; + padding: 0.5em 0.3em; +} +ul.contextual-links li a:hover { + text-decoration: underline; +} diff --git misc/contextual_links.js misc/contextual_links.js index d1a9a9b..24f6c6a 100644 --- misc/contextual_links.js +++ misc/contextual_links.js @@ -8,8 +8,20 @@ Drupal.contextualLinks = Drupal.contextualLinks || {}; */ Drupal.behaviors.contextualLinks = { attach: function (context) { - $('ul.contextual-links', context).once('contextual-links', function () { - $(this).hover(Drupal.contextualLinks.hover, Drupal.contextualLinks.hoverOut); + $('div.contextual-links-wrapper', context).once('contextual-links', function () { + var $wrapper = $(this); + var $trigger = $('').text(Drupal.t('Configure')).toggle( + function () { + $wrapper.addClass('contextual-links-wrapper-active'); + return false; + }, + function () { + $wrapper.removeClass('contextual-links-wrapper-active'); + return false; + } + ); + $wrapper.prepend($trigger) + .hover(Drupal.contextualLinks.hover, Drupal.contextualLinks.hoverOut); }); } }; @@ -18,7 +30,7 @@ Drupal.behaviors.contextualLinks = { * Enables outline for the region contextual links are associated with. */ Drupal.contextualLinks.hover = function () { - $(this).addClass('contextual-links-link-active') + $(this).addClass('contextual-links-active') .closest('.contextual-links-region').addClass('contextual-links-region-active'); }; @@ -26,7 +38,7 @@ Drupal.contextualLinks.hover = function () { * Disables outline for the region contextual links are associated with. */ Drupal.contextualLinks.hoverOut = function () { - $(this).removeClass('contextual-links-link-active') + $(this).removeClass('contextual-links-active') .closest('.contextual-links-region').removeClass('contextual-links-region-active'); }; diff --git modules/system/system.module modules/system/system.module index 0d2363d..705b8da 100644 --- modules/system/system.module +++ modules/system/system.module @@ -3621,6 +3621,8 @@ function system_build_contextual_links($element) { $build = array(); if ($links) { $build = array( + '#prefix' => '', '#theme' => 'links', '#links' => $links, '#attributes' => array('class' => array('contextual-links')), diff --git themes/garland/style.css themes/garland/style.css index 73f2b5c..11d8922 100644 --- themes/garland/style.css +++ themes/garland/style.css @@ -841,17 +841,6 @@ tr.even td.menu-disabled { } /** - * Contextual links. - */ -.contextual-links-region-active { - outline: #027AC6 dashed 1px; -} -.block ul.contextual-links { - margin: 0; - padding: 0; -} - -/** * Collapsible fieldsets */ fieldset {