### Eclipse Workspace Patch 1.0
#P module - admin_menu
Index: admin_menu.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/admin_menu/admin_menu.inc,v
retrieving revision 1.75
diff -u -r1.75 admin_menu.inc
--- admin_menu.inc	17 Mar 2010 20:49:40 -0000	1.75
+++ admin_menu.inc	17 May 2010 21:16:09 -0000
@@ -579,17 +579,11 @@
  * Form builder function for module settings.
  */
 function admin_menu_theme_settings() {
-  $form['admin_menu_margin_top'] = array(
-    '#type' => 'checkbox',
-    '#title' => t('Adjust top margin'),
-    '#default_value' => 1,
-    '#description' => t('If enabled, the site output is shifted down approximately 20 pixels from the top of the viewport to display the administration menu. If disabled, some absolute- or fixed-positioned page elements may be covered by the administration menu.'),
-  );
   $form['admin_menu_position_fixed'] = array(
     '#type' => 'checkbox',
     '#title' => t('Keep menu at top of page'),
     '#default_value' => 0,
-    '#description' => t('If enabled, the administration menu is always displayed at the top of the browser viewport (even after the page is scrolled). <strong>Note: In some browsers, this setting results in a malformed page, an invisible cursor, non-selectable elements in forms, or other issues. Disable this option if these issues occur.</strong>'),
+    '#description' => t('If enabled, the administration menu is always displayed at the top of the browser viewport (even after the page is scrolled).'),
   );
   $form['tweaks'] = array(
     '#type' => 'fieldset',
Index: admin_menu.css
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/admin_menu/admin_menu.css,v
retrieving revision 1.37
diff -u -r1.37 admin_menu.css
--- admin_menu.css	20 Feb 2010 01:02:54 -0000	1.37
+++ admin_menu.css	17 May 2010 21:16:09 -0000
@@ -13,10 +13,8 @@
   background: #101010 url(images/bkg.png) bottom left repeat-x;
   font-size: 9px;
   font-family: "lucida grande", tahoma, verdana, arial, sans-serif;
-  left: 0;
-  position: absolute;
+  min-height: 20px;
   text-align: left;
-  top: 0;
   width: 100%;
 }
 #admin-menu-wrapper {
@@ -42,9 +40,6 @@
   border-left: 1px solid #323232;
   border-right: none;
 }
-body.admin-menu {
-  margin-top: 20px !important;
-}
 
 /* All lists */
 #admin-menu,
Index: admin_menu.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/admin_menu/admin_menu.module,v
retrieving revision 1.113
diff -u -r1.113 admin_menu.module
--- admin_menu.module	17 Mar 2010 20:49:40 -0000	1.113
+++ admin_menu.module	17 May 2010 21:16:09 -0000
@@ -133,6 +133,9 @@
   if ($user->uid == 1) {
     drupal_add_css($path . '/admin_menu.uid1.css', array('preprocess' => FALSE));
   }
+  if (variable_get('admin_menu_position_fixed', 0)) {
+    drupal_add_js('misc/displace.js', array('weight' => JS_LIBRARY - 1));
+  }
   // Performance: Defer execution.
   drupal_add_js($path . '/admin_menu.js', array('defer' => TRUE));
 
@@ -158,12 +161,6 @@
     $settings['replacements'] = $replacements;
   }
 
-  if ($setting = variable_get('admin_menu_margin_top', 1)) {
-    $settings['margin_top'] = $setting;
-  }
-  if ($setting = variable_get('admin_menu_position_fixed', 0)) {
-    $settings['position_fixed'] = $setting;
-  }
   if ($setting = variable_get('admin_menu_tweak_tabs', 0)) {
     $settings['tweak_tabs'] = $setting;
   }
@@ -200,10 +197,10 @@
 }
 
 /**
- * Implements hook_page_alter().
+ * Implements hook_page_build().
  */
-function admin_menu_page_alter(&$page) {
-  $page['page_bottom']['admin_menu'] = array(
+function admin_menu_page_build(&$page) {
+  $page['page_top']['admin_menu'] = array(
     '#markup' => admin_menu_output(),
   );
 }
@@ -380,7 +377,13 @@
   //   request on every page?
   if (!empty($_COOKIE['has_js']) && strpos($_GET['q'], 'js/admin_menu/cache') !== 0) {
     if (admin_menu_cache_get($cid)) {
-      return;
+      // Add site name as CSS class for development/staging theming purposes. We
+      // leverage the cookie domain instead of HTTP_HOST to account for many (but
+      // not all) multi-domain setups (e.g. language-based sub-domains).
+      $class = 'admin-menu-site' . drupal_strtolower(preg_replace('/[^a-zA-Z0-9-]/', '-', $GLOBALS['cookie_domain']));
+      $class .= ' displace-top' . (variable_get('admin_menu_position_fixed', 0) ? '' : ' displace-absolute');
+      // Always output container to harden JS-less support.
+      return '<div id="admin-menu" class="' . $class . '"></div>';
     }
   }
 
@@ -397,9 +400,9 @@
     // Add site name as CSS class for development/staging theming purposes. We
     // leverage the cookie domain instead of HTTP_HOST to account for many (but
     // not all) multi-domain setups (e.g. language-based sub-domains).
-    $class_site = 'admin-menu-site' . drupal_strtolower(preg_replace('/[^a-zA-Z0-9-]/', '-', $GLOBALS['cookie_domain']));
-    // @todo Always output container to harden JS-less support.
-    $content['#prefix'] = '<div id="admin-menu" class="' . $class_site . '"><div id="admin-menu-wrapper"><ul>';
+    $class = 'admin-menu-site' . drupal_strtolower(preg_replace('/[^a-zA-Z0-9-]/', '-', $GLOBALS['cookie_domain']));
+    $class .= ' displace-top' . (variable_get('admin_menu_position_fixed', 0) ? '' : ' displace-absolute');
+    $content['#prefix'] = '<div id="admin-menu" class="' . $class . '"><div id="admin-menu-wrapper"><ul>';
     $content['#suffix'] = '</ul></div></div>';
 
     // Load menu builder functions.
Index: admin_menu.js
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/admin_menu/admin_menu.js,v
retrieving revision 1.32
diff -u -r1.32 admin_menu.js
--- admin_menu.js	20 Feb 2010 23:44:00 -0000	1.32
+++ admin_menu.js	17 May 2010 21:16:09 -0000
@@ -16,8 +16,6 @@
     // Initialize settings.
     settings.admin_menu = $.extend({
       suppress: false,
-      margin_top: false,
-      position_fixed: false,
       tweak_modules: false,
       tweak_permissions: false,
       tweak_tabs: false,
@@ -30,17 +28,18 @@
     if (settings.admin_menu.suppress) {
       return;
     }
-    var $adminMenu = $('#admin-menu:not(.admin-menu-processed)', context);
+    var $adminMenu = $('#admin-menu', context);
     // Client-side caching; if administration menu is not in the output, it is
     // fetched from the server and cached in the browser.
-    if (!$adminMenu.length && settings.admin_menu.hash) {
+    if (!$adminMenu.is('.admin-menu-processed') && settings.admin_menu.hash) {
       Drupal.admin.getCache(settings.admin_menu.hash, function (response) {
-          if (typeof response == 'string' && response.length > 0) {
-            $('body', context).prepend(response);
-          }
-          var $adminMenu = $('#admin-menu:not(.admin-menu-processed)', context);
+        if (typeof response == 'string' && response.length > 0) {
+          $adminMenu.replaceWith(response);
+
+          Drupal.attachBehaviors($adminMenu[0], settings);
           // Apply our behaviors.
           Drupal.admin.attachBehaviors(context, settings, $adminMenu);
+        }
       });
     }
     // If the menu is in the output already, this means there is a new version.
@@ -89,21 +88,6 @@
 };
 
 /**
- * Apply margin to page.
- *
- * Note that directly applying marginTop does not work in IE. To prevent
- * flickering/jumping page content with client-side caching, this is a regular
- * Drupal behavior.
- */
-Drupal.behaviors.adminMenuMarginTop = {
-  attach: function (context, settings) {
-    if (!settings.admin_menu.suppress && settings.admin_menu.margin_top) {
-      $('body:not(.admin-menu)', context).addClass('admin-menu');
-    }
-  }
-};
-
-/**
  * Retrieve content from client-side cache.
  *
  * @param hash
@@ -146,16 +130,6 @@
 };
 
 /**
- * Apply 'position: fixed'.
- */
-Drupal.admin.behaviors.positionFixed = function (context, settings, $adminMenu) {
-  if (settings.admin_menu.position_fixed) {
-    $adminMenu.addClass('admin-menu-position-fixed');
-    $adminMenu.css('position', 'fixed');
-  }
-};
-
-/**
  * Move page tabs into administration menu.
  */
 Drupal.admin.behaviors.pageTabs = function (context, settings, $adminMenu) {
Index: admin_menu_toolbar/admin_menu_toolbar.css
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/admin_menu/admin_menu_toolbar/admin_menu_toolbar.css,v
retrieving revision 1.5
diff -u -r1.5 admin_menu_toolbar.css
--- admin_menu_toolbar/admin_menu_toolbar.css	20 Feb 2010 02:17:55 -0000	1.5
+++ admin_menu_toolbar/admin_menu_toolbar.css	17 May 2010 21:16:09 -0000
@@ -10,25 +10,23 @@
  * @todo Separate shortcut functionality into own module/widget.
  */
 
-/* Adjust margin/height */
-html body.admin-menu {
-  margin-top: 29px !important;
-}
-body div#toolbar {
-  top: 30px;
-}
-
 #admin-menu {
+  min-height: 30px;
   font: normal 0.9em "Lucida Grande", Verdana, sans-serif;
+}
+.displace-processed #admin-menu.displace-top {
+  margin: 0 -20px;
+  padding: 0 20px;
   box-shadow: 0 3px 20px #000;
   -moz-box-shadow: 0 3px 20px #000;
   -webkit-box-shadow: 0 3px 20px #000;
   filter: progid:DXImageTransform.Microsoft.Shadow(color=#000000, direction='180', strength='10');
   -ms-filter: "progid:DXImageTransform.Microsoft.Shadow(color=#000000, direction='180', strength='10')";
 }
-#admin-menu.admin-menu-position-fixed {
-  margin: 0 -20px;
-  padding: 0 20px;
+.displace-processed #admin-menu.displace-top.displace-absolute {
+  margin: 0;
+  padding: 0;
+  width: 100%;
 }
 #admin-menu-wrapper {
   padding: 5px 10px 0;
