Commit f70b6182 authored by Dries's avatar Dries

- Patch #520368 by Gábor Hojtsy: fixed Admin toolbar breaks sticky table headers.

parent 9dd2ce28
......@@ -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.
......
......@@ -80,4 +80,8 @@ Drupal.admin.toolbar.toggle = function() {
}
}
Drupal.admin.toolbar.height = function() {
return $("#toolbar").height();
}
})(jQuery);
......@@ -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',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment