summaryrefslogtreecommitdiffstatshomepage
path: root/core/misc/tableheader.es6.js
diff options
context:
space:
mode:
authorAlex Pott <alex.a.pott@googlemail.com>2021-05-24 12:05:48 +0100
committerAlex Pott <alex.a.pott@googlemail.com>2021-05-24 12:05:48 +0100
commit9ec511c812ecfc46d9d652c15c250fa2456254bd (patch)
tree312936d0e4ddcf5f15dada2ea37cc19f59be9abd /core/misc/tableheader.es6.js
parent24494c2e0b757f880686a813bf705bc2a5eb4db9 (diff)
downloaddrupal-9ec511c812ecfc46d9d652c15c250fa2456254bd.tar.gz
drupal-9ec511c812ecfc46d9d652c15c250fa2456254bd.zip
Issue #1870006 by nod_, BarisW, alwaysworking, Renrhaf, pk188, andrewmacpherson, ranjith_kumar_k_u, vikashsoni, Gauravmahlawat, wolffereast, Wim Leers, jessebeach, xjm: HTML5 validation with table sticky header is misaligned over the toolbar
Diffstat (limited to 'core/misc/tableheader.es6.js')
-rw-r--r--core/misc/tableheader.es6.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/core/misc/tableheader.es6.js b/core/misc/tableheader.es6.js
index 2debc838a3b7..f7fc2f200e92 100644
--- a/core/misc/tableheader.es6.js
+++ b/core/misc/tableheader.es6.js
@@ -208,6 +208,8 @@
* Create the duplicate header.
*/
createSticky() {
+ // For caching purposes.
+ this.$html = $('html');
// Clone the table header so it inherits original jQuery properties.
const $stickyHeader = this.$originalHeader.clone(true);
// Hide the table to avoid a flash of the header clone upon page load.
@@ -245,6 +247,11 @@
if (typeof offsetLeft === 'number') {
css.left = `${this.tableOffset.left - offsetLeft}px`;
}
+ this.$html.css(
+ 'scroll-padding-top',
+ displace.offsets.top +
+ (this.stickyVisible ? this.$stickyTable.height() : 0),
+ );
return this.$stickyTable.css(css);
},