Skip to content

Commit bcbe852

Browse files
committed
Fix Names column scroll lock #112
Fix Names column scroll lock #112
1 parent 6d56bfc commit bcbe852

2 files changed

Lines changed: 15 additions & 2 deletions

File tree

locallib.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1541,7 +1541,8 @@ protected function report_add_toggle_button_row($table) {
15411541
foreach ($passedrow[0] as $key => $item) {
15421542
if ($key == 0) {
15431543
// Left align + colspan of 2 (overlapping the button column).
1544-
$output .= '<td colspan="2" style=" text-align: left; width: '.$table->size[0].';" class="cell c0"></td>';
1544+
$output .= '<td style=" text-align: left; width: '.$table->size[0].';" class="cell c0 headcol_checklist"></td>';
1545+
$output .= '<td style=" text-align: left; width: '.$table->size[0].';" class="cell level0"></td>';
15451546
} else {
15461547
$size = $table->size[$key];
15471548
$cellclass = 'cell c'.$key.' level'.$table->level[$key];
@@ -1604,6 +1605,9 @@ protected function print_report_table($table, $editchecks, $disableditems): stri
16041605
if ($key == 0 && $editchecks) {
16051606
$colspan = 'colspan="2"';
16061607
}
1608+
if ($key == 0) {
1609+
$levelclass .= ' headcol_checklist';
1610+
}
16071611
$output .= '<th '.$colspan.' style="vertical-align:top; text-align: center; width:'.$size.
16081612
'" class="header c'.$key.$levelclass.'" scope="col">';
16091613
$output .= $heading.'</th>';
@@ -1644,7 +1648,8 @@ protected function print_report_table($table, $editchecks, $disableditems): stri
16441648
}
16451649
if ($colkey == 0) {
16461650
// First item is the name.
1647-
$output .= '<td style=" text-align: left; width: '.$table->size[0].';" class="cell c0">'.$item.'</td>';
1651+
$output .= '<td style=" text-align: left; width: '
1652+
. $table->size[0] . ';" class="cell c0 headcol_checklist">' . $item . '</td>';
16481653
} else {
16491654
$size = $table->size[$colkey];
16501655
$img = '&nbsp;';

styles.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,3 +301,11 @@ ol.checklist label {
301301
.checklist-groupingname {
302302
color: #ccc;
303303
}
304+
305+
.headcol_checklist {
306+
background-color: #e1e1df;
307+
position: sticky;
308+
left: 0;
309+
min-width: 150px;
310+
max-width: 150px;
311+
}

0 commit comments

Comments
 (0)