diff options
-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', |