From 0a56c2804db661f4dd83b3b6ccbd7d08a78d54a8 Mon Sep 17 00:00:00 2001 From: Trevor Allen Date: Tue, 14 Mar 2017 17:52:49 -0700 Subject: [PATCH] adding sticky headers to kalatheme_table --- includes/core.inc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/includes/core.inc b/includes/core.inc index 0a02f9a..a1df8ef 100644 --- a/includes/core.inc +++ b/includes/core.inc @@ -21,6 +21,13 @@ function kalatheme_table($variables) { $sticky = $variables['sticky']; $empty = $variables['empty']; + if (count($header) && $sticky) { + drupal_add_js('misc/tableheader.js'); + // Add 'sticky-enabled' class to the table to identify it for JS. + // This is needed to target tables constructed by this function. + $attributes['class'][] = 'sticky-enabled'; + } + $output = '\n"; if (isset($caption)) {