diff options
author | Dries Buytaert <dries@buytaert.net> | 2009-09-15 20:50:48 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2009-09-15 20:50:48 +0000 |
commit | f70b6182e136a66039711f6a452fd582698f3dd9 (patch) | |
tree | d22c292f4de01c531966cfbe925c2360eb3ad9af | |
parent | 9dd2ce283e60b066386be6d799eded5c72d0139f (diff) | |
download | brdo-f70b6182e136a66039711f6a452fd582698f3dd9.tar.gz brdo-f70b6182e136a66039711f6a452fd582698f3dd9.tar.bz2 |
- Patch #520368 by Gábor Hojtsy: fixed Admin toolbar breaks sticky table headers.
-rw-r--r-- | misc/tableheader.js | 5 | ||||
-rw-r--r-- | modules/toolbar/toolbar.js | 4 | ||||
-rw-r--r-- | modules/toolbar/toolbar.module | 4 |
3 files changed, 12 insertions, 1 deletions
diff --git a/misc/tableheader.js b/misc/tableheader.js index 52f6b6d33..1b772af3c 100644 --- a/misc/tableheader.js +++ b/misc/tableheader.js @@ -41,11 +41,14 @@ Drupal.behaviors.tableHeader = { // Track positioning and visibility. function tracker(e) { + // Reset top position of sticky table headers to the current top offset. + var topOffset = Drupal.settings.tableHeaderOffset ? eval(Drupal.settings.tableHeaderOffset + '()') : 0; + $('.sticky-header').css('top', topOffset + 'px'); // Save positioning data. var viewHeight = document.documentElement.scrollHeight || document.body.scrollHeight; if (e.viewHeight != viewHeight) { e.viewHeight = viewHeight; - e.vPosition = $(e.table).offset().top - 4; + e.vPosition = $(e.table).offset().top - 4 - topOffset; e.hPosition = $(e.table).offset().left; e.vLength = e.table.clientHeight - 100; // Resize header and its cell widths. diff --git a/modules/toolbar/toolbar.js b/modules/toolbar/toolbar.js index c2653d91a..50a60a796 100644 --- a/modules/toolbar/toolbar.js +++ b/modules/toolbar/toolbar.js @@ -80,4 +80,8 @@ Drupal.admin.toolbar.toggle = function() { } } +Drupal.admin.toolbar.height = function() { + return $("#toolbar").height(); +} + })(jQuery); diff --git a/modules/toolbar/toolbar.module b/modules/toolbar/toolbar.module index 6b931632a..f883588f0 100644 --- a/modules/toolbar/toolbar.module +++ b/modules/toolbar/toolbar.module @@ -65,6 +65,10 @@ function toolbar_build() { 'js' => array( $module_path . '/toolbar.js', array('data' => 'misc/jquery.cookie.js', 'weight' => JS_LIBRARY + 2), + array( + 'data' => array('tableHeaderOffset' => 'Drupal.admin.toolbar.height'), + 'type' => 'setting' + ), ), 'css' => array( $module_path . '/toolbar.css', |