Skip to content

Commit

Permalink
Fix Names column scroll lock #112
Browse files Browse the repository at this point in the history
Fix Names column scroll lock #112
  • Loading branch information
glepod committed Apr 22, 2024
1 parent 6d56bfc commit bcbe852
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
9 changes: 7 additions & 2 deletions locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1541,7 +1541,8 @@ protected function report_add_toggle_button_row($table) {
foreach ($passedrow[0] as $key => $item) {
if ($key == 0) {
// Left align + colspan of 2 (overlapping the button column).
$output .= '<td colspan="2" style=" text-align: left; width: '.$table->size[0].';" class="cell c0"></td>';
$output .= '<td style=" text-align: left; width: '.$table->size[0].';" class="cell c0 headcol_checklist"></td>';
$output .= '<td style=" text-align: left; width: '.$table->size[0].';" class="cell level0"></td>';
} else {
$size = $table->size[$key];
$cellclass = 'cell c'.$key.' level'.$table->level[$key];
Expand Down Expand Up @@ -1604,6 +1605,9 @@ protected function print_report_table($table, $editchecks, $disableditems): stri
if ($key == 0 && $editchecks) {
$colspan = 'colspan="2"';
}
if ($key == 0) {
$levelclass .= ' headcol_checklist';
}
$output .= '<th '.$colspan.' style="vertical-align:top; text-align: center; width:'.$size.
'" class="header c'.$key.$levelclass.'" scope="col">';
$output .= $heading.'</th>';
Expand Down Expand Up @@ -1644,7 +1648,8 @@ protected function print_report_table($table, $editchecks, $disableditems): stri
}
if ($colkey == 0) {
// First item is the name.
$output .= '<td style=" text-align: left; width: '.$table->size[0].';" class="cell c0">'.$item.'</td>';
$output .= '<td style=" text-align: left; width: '
. $table->size[0] . ';" class="cell c0 headcol_checklist">' . $item . '</td>';
} else {
$size = $table->size[$colkey];
$img = '&nbsp;';
Expand Down
8 changes: 8 additions & 0 deletions styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -301,3 +301,11 @@ ol.checklist label {
.checklist-groupingname {
color: #ccc;
}

.headcol_checklist {
background-color: #e1e1df;
position: sticky;
left: 0;
min-width: 150px;
max-width: 150px;
}

0 comments on commit bcbe852

Please sign in to comment.