diff options
Diffstat (limited to 'modules/toolbar')
-rw-r--r-- | modules/toolbar/toolbar.css | 35 | ||||
-rw-r--r-- | modules/toolbar/toolbar.js | 17 | ||||
-rw-r--r-- | modules/toolbar/toolbar.module | 7 | ||||
-rw-r--r-- | modules/toolbar/toolbar.tpl.php | 2 |
4 files changed, 15 insertions, 46 deletions
diff --git a/modules/toolbar/toolbar.css b/modules/toolbar/toolbar.css index 5fc8159baea..7122e4ecc72 100644 --- a/modules/toolbar/toolbar.css +++ b/modules/toolbar/toolbar.css @@ -1,12 +1,6 @@ /* $Id$ */ -body.toolbar { - padding-top: 2.2em; -} -body.toolbar-drawer { - padding-top: 5.3em; -} /** * Aggressive resets so we can achieve a consistent look in hostile CSS @@ -32,10 +26,8 @@ body.toolbar-drawer { font: normal 0.9em "Lucida Grande", Verdana, sans-serif; background: #666; color: #ccc; - position: fixed; - top: 0; - left: 0; - right: 0; +} +.displace-processed #toolbar { margin: 0 -20px; padding: 0 20px; z-index: 600; @@ -45,6 +37,14 @@ body.toolbar-drawer { filter: progid:DXImageTransform.Microsoft.Shadow(color=#000000, direction='180', strength='10'); -ms-filter: "progid:DXImageTransform.Microsoft.Shadow(color=#000000, direction='180', strength='10')"; } +.displace-unsupported #toolbar { + margin: 0; + padding-right: 0; + left: -20px; + right: 0; + width: 100%; +} + #toolbar div.collapsed { display: none; @@ -132,18 +132,3 @@ body.toolbar-drawer { position: relative; padding: 0 10px; } - -/** - * IE 6 Fix. - * - * IE 6 shows elements with position:fixed as position:static so we replace - * it with position:absolute; toolbar needs it's z-index to stay above overlay. - */ -* html #toolbar { - position: absolute; - margin: 0; - padding-right: 0; - left: -20px; - right: 0; - width: 100%; -} diff --git a/modules/toolbar/toolbar.js b/modules/toolbar/toolbar.js index 85129f8243a..be95c76abae 100644 --- a/modules/toolbar/toolbar.js +++ b/modules/toolbar/toolbar.js @@ -15,9 +15,8 @@ Drupal.behaviors.toolbar = { // Toggling toolbar drawer. $('#toolbar a.toggle', context).once('toolbar-toggle').click(function(e) { Drupal.toolbar.toggle(); - // As the toolbar is an overlay displaced region, overlay should be - // notified of it's height change to adapt its position. - $(window).triggerHandler('resize.overlay-event'); + // Allow resize event handlers to recalculate sizes/positions. + $(window).triggerHandler('resize'); return false; }); } @@ -49,7 +48,6 @@ Drupal.toolbar.collapse = function() { .removeClass('toggle-active') .attr('title', toggle_text) .html(toggle_text); - $('body').removeClass('toolbar-drawer').css('paddingTop', Drupal.toolbar.height()); $.cookie( 'Drupal.toolbar.collapsed', 1, @@ -71,7 +69,6 @@ Drupal.toolbar.expand = function() { .addClass('toggle-active') .attr('title', toggle_text) .html(toggle_text); - $('body').addClass('toolbar-drawer').css('paddingTop', Drupal.toolbar.height()); $.cookie( 'Drupal.toolbar.collapsed', 0, @@ -95,14 +92,4 @@ Drupal.toolbar.toggle = function() { } }; -Drupal.toolbar.height = function() { - var height = $('#toolbar').outerHeight(); - // In IE, Shadow filter adds some extra height, so we need to remove it from - // the returned height. - if ($('#toolbar').css('filter').match(/DXImageTransform\.Microsoft\.Shadow/)) { - height -= $('#toolbar').get(0).filters.item("DXImageTransform.Microsoft.Shadow").strength; - } - return height; -}; - })(jQuery); diff --git a/modules/toolbar/toolbar.module b/modules/toolbar/toolbar.module index c245a8fa7f1..b7579021601 100644 --- a/modules/toolbar/toolbar.module +++ b/modules/toolbar/toolbar.module @@ -177,12 +177,9 @@ function toolbar_view() { '#theme' => 'toolbar', '#attached'=> array( 'js' => array( - $module_path . '/toolbar.js', + array('data' => 'misc/displace.js', 'weight' => JS_LIBRARY - 1), array('data' => 'misc/jquery.cookie.js', 'weight' => JS_LIBRARY + 2), - array( - 'data' => array('tableHeaderOffset' => 'Drupal.toolbar.height'), - 'type' => 'setting' - ), + $module_path . '/toolbar.js', ), 'css' => array( $module_path . '/toolbar.css', diff --git a/modules/toolbar/toolbar.tpl.php b/modules/toolbar/toolbar.tpl.php index d38aae6965f..eac3e88ab0c 100644 --- a/modules/toolbar/toolbar.tpl.php +++ b/modules/toolbar/toolbar.tpl.php @@ -22,7 +22,7 @@ * @see template_preprocess_toolbar() */ ?> -<div id="toolbar" class="<?php print $classes; ?> clearfix"> +<div id="toolbar" class="<?php print $classes; ?> displace-top clearfix"> <div class="toolbar-menu clearfix"> <?php print render($toolbar['toolbar_home']); ?> <?php print render($toolbar['toolbar_user']); ?> |