Commit 061433ad authored by Gábor Hojtsy's avatar Gábor Hojtsy
Browse files

#208197 by dvessel: back to cloning the table header only in tableheader.js...

#208197 by dvessel: back to cloning the table header only in tableheader.js (fixes radio button issues and Safari 2 crashing)
parent e78d7eb2
......@@ -10,23 +10,12 @@ Drupal.behaviors.tableHeader = function (context) {
var headers = [];
$('table thead:not(.tableHeader-processed)', context).each(function () {
// Clone table and remove unwanted elements so it inherits original properties.
var headerClone = $(this.parentNode).clone(true).insertBefore(this.parentNode).addClass('sticky-header').css({
// Clone thead so it inherits original jQuery properties.
var headerClone = $(this).clone(true).insertBefore(this.parentNode).wrap('<table class="sticky-header"></table>').parent().css({
position: 'fixed',
visibility: 'hidden',
top: '0px'
});
// Sets an id for cloned table header.
var headerID = headerClone.attr('id');
if (headerID != '') {
headerClone.attr('id', headerID + '-header');
}
// Everything except thead must be removed. See theme_table().
$('tbody', headerClone).remove();
$('caption', headerClone).remove();
var headerClone = $(headerClone)[0];
headers.push(headerClone);
......@@ -50,6 +39,7 @@ Drupal.behaviors.tableHeader = function (context) {
e.vPosition = $(e.table).offset().top;
e.hPosition = $(e.table).offset().left;
e.vLength = $(e.table).height();
e.resizeWidths = true;
}
// Track horizontal positioning relative to the viewport and set visibility.
......
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