Commit 099a8ace authored by Dries's avatar Dries

Issue #2014309 by nod_: Sticky table headers default to FALSE.

parent 2d6446f9
...@@ -3106,7 +3106,7 @@ function drupal_common_theme() { ...@@ -3106,7 +3106,7 @@ function drupal_common_theme() {
'template' => 'breadcrumb', 'template' => 'breadcrumb',
), ),
'table' => array( 'table' => array(
'variables' => array('header' => NULL, 'rows' => NULL, 'attributes' => array(), 'caption' => NULL, 'colgroups' => array(), 'sticky' => TRUE, 'responsive' => TRUE, 'empty' => ''), 'variables' => array('header' => NULL, 'rows' => NULL, 'attributes' => array(), 'caption' => NULL, 'colgroups' => array(), 'sticky' => FALSE, 'responsive' => TRUE, 'empty' => ''),
), ),
'tablesort_indicator' => array( 'tablesort_indicator' => array(
'variables' => array('style' => NULL), 'variables' => array('style' => NULL),
......
...@@ -27,7 +27,7 @@ public static function getInfo() { ...@@ -27,7 +27,7 @@ public static function getInfo() {
function testThemeTableStickyHeaders() { function testThemeTableStickyHeaders() {
$header = array('one', 'two', 'three'); $header = array('one', 'two', 'three');
$rows = array(array(1,2,3), array(4,5,6), array(7,8,9)); $rows = array(array(1,2,3), array(4,5,6), array(7,8,9));
$this->content = theme('table', array('header' => $header, 'rows' => $rows)); $this->content = theme('table', array('header' => $header, 'rows' => $rows, 'sticky' => TRUE));
$js = drupal_add_js(); $js = drupal_add_js();
$this->assertTrue(isset($js['core/misc/tableheader.js']), 'tableheader.js was included when $sticky = TRUE.'); $this->assertTrue(isset($js['core/misc/tableheader.js']), 'tableheader.js was included when $sticky = TRUE.');
$this->assertRaw('sticky-enabled', 'Table has a class of sticky-enabled when $sticky = TRUE.'); $this->assertRaw('sticky-enabled', 'Table has a class of sticky-enabled when $sticky = TRUE.');
......
...@@ -246,6 +246,7 @@ function theme_user_admin_permissions($variables) { ...@@ -246,6 +246,7 @@ function theme_user_admin_permissions($variables) {
'#attributes' => array( '#attributes' => array(
'id' => 'permissions', 'id' => 'permissions',
), ),
'#sticky' => TRUE,
); );
$output = drupal_render($system_compact_link); $output = drupal_render($system_compact_link);
$output .= drupal_render($table); $output .= drupal_render($table);
......
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