From 63f40df61080e7dd770e404b73b1a9a894bbd108 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Wed, 10 Feb 2010 10:54:12 +0000 Subject: - Patch #535066 by jide, jbrown, marvil07, yoroy, mcjim, TheRec, mr.baileys: use CSS3 / IE filter to render toolbar shadow. --- modules/toolbar/toolbar.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'modules/toolbar/toolbar.js') diff --git a/modules/toolbar/toolbar.js b/modules/toolbar/toolbar.js index a71d22daa..673507fbe 100644 --- a/modules/toolbar/toolbar.js +++ b/modules/toolbar/toolbar.js @@ -49,7 +49,7 @@ Drupal.toolbar.collapse = function() { .removeClass('toggle-active') .attr('title', toggle_text) .html(toggle_text); - $('body').removeClass('toolbar-drawer').css('paddingTop', $('#toolbar').outerHeight()); + $('body').addClass('toolbar-drawer').css('paddingTop', Drupal.toolbar.height()); $.cookie( 'Drupal.toolbar.collapsed', 1, @@ -71,7 +71,7 @@ Drupal.toolbar.expand = function() { .addClass('toggle-active') .attr('title', toggle_text) .html(toggle_text); - $('body').addClass('toolbar-drawer').css('paddingTop', $('#toolbar').outerHeight()); + $('body').addClass('toolbar-drawer').css('paddingTop', Drupal.toolbar.height()); $.cookie( 'Drupal.toolbar.collapsed', 0, @@ -96,7 +96,13 @@ Drupal.toolbar.toggle = function() { }; Drupal.toolbar.height = function() { - return $("#toolbar").height(); + 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); -- cgit v1.2.3