Index: modules/toolbar/toolbar.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/toolbar/toolbar.module,v
retrieving revision 1.32
diff -u -r1.32 toolbar.module
--- modules/toolbar/toolbar.module	12 Jan 2010 23:04:48 -0000	1.32
+++ modules/toolbar/toolbar.module	14 Jan 2010 11:26:16 -0000
@@ -176,6 +176,7 @@
       'js' => array(
         $module_path . '/toolbar.js',
         array('data' => 'misc/jquery.cookie.js', 'weight' => JS_LIBRARY + 2),
+        array('data' => 'misc/jquery.ba-bbq.js', 'weight' => JS_LIBRARY + 2),
         array(
           'data' => array('tableHeaderOffset' => 'Drupal.admin.toolbar.height'),
           'type' => 'setting'
Index: modules/toolbar/toolbar.js
===================================================================
RCS file: /cvs/drupal/drupal/modules/toolbar/toolbar.js,v
retrieving revision 1.13
diff -u -r1.13 toolbar.js
--- modules/toolbar/toolbar.js	7 Jan 2010 07:57:09 -0000	1.13
+++ modules/toolbar/toolbar.js	14 Jan 2010 11:26:16 -0000
@@ -18,6 +18,13 @@
       $(window).triggerHandler('resize.overlay-event');
       return false;
     });
+
+    $(window)
+    // Ensure the toolbar doesn't hide content when named anchor is clicked.
+    .bind('hashchange.drupal-toolbar', Drupal.admin.toolbar.hashchange)
+    // Trigger the hashchange event once, after the page is loaded, to handle
+    // hash in original page request.
+    .trigger('hashchange');
   }
 };
 
@@ -99,6 +106,19 @@
   }
 };
 
+/**
+ * Adjust scrolltop so toolbar doesn't hide content when URL includes hash.
+ */
+Drupal.admin.toolbar.hashchange = function (event) {
+  if (location.hash != '') {
+    $anchor = $(location.hash);
+    if ($anchor.length) {
+      var scrollLocation = $anchor.offset().top - Drupal.admin.toolbar.height();
+      $(window).scrollTop(scrollLocation);
+    }
+  }
+};
+
 Drupal.admin.toolbar.height = function() {
   return $("#toolbar").height();
 };
