MDL-80748 mod_assign: grading table now has a sticky header

`position: sticky` doesn't work in responsive tables because responsive
tables have scrollbars, making them the nearest ancestor with a
scrolling mechanism for the sticky header. As a result, the table can no
longer be responsive. This change is actually desired and was intended
for MDL-81860. Since we implemented it here, we can close the other
issue.
This commit is contained in:
Shamim Rezaie
2024-07-01 15:58:20 +10:00
parent e44d630be2
commit f5f8fb5ff6
5 changed files with 29 additions and 0 deletions
+2
View File
@@ -4602,6 +4602,7 @@ class assign {
// Load and print the table of submissions.
if ($showquickgrading && $quickgrading) {
$gradingtable = new assign_grading_table($this, $perpage, $filter, 0, true);
$gradingtable->responsive = false;
$table = $this->get_renderer()->render($gradingtable);
$page = optional_param('page', null, PARAM_INT);
$quickformparams = array('cm'=>$this->get_course_module()->id,
@@ -4613,6 +4614,7 @@ class assign {
$o .= $this->get_renderer()->render(new assign_form('quickgradingform', $quickgradingform));
} else {
$gradingtable = new assign_grading_table($this, $perpage, $filter, 0, false);
$gradingtable->responsive = false;
$o .= $this->get_renderer()->render($gradingtable);
}
+9
View File
@@ -139,6 +139,15 @@
display: block;
}
.path-mod-assign .gradingtable table {
border-collapse: separate;
border-spacing: 0;
}
.path-mod-assign .gradingtable thead th {
background-color: white;
}
.path-mod-assign .gradingtable tr.selectedrow td {
background-color: #fec;
}
+6
View File
@@ -1497,6 +1497,12 @@ $popout-header-height: 4rem;
background-color: $card-bg;
}
.path-mod-assign .gradingtable thead tr {
position: sticky;
top: $navbar-height;
z-index: 1;
}
/**
* Mod LTI.
*/
+6
View File
@@ -34761,6 +34761,12 @@ img.userpicture {
background-color: #fff;
}
.path-mod-assign .gradingtable thead tr {
position: sticky;
top: 60px;
z-index: 1;
}
/**
* Mod LTI.
*/
+6
View File
@@ -34761,6 +34761,12 @@ img.userpicture {
background-color: #fff;
}
.path-mod-assign .gradingtable thead tr {
position: sticky;
top: 50px;
z-index: 1;
}
/**
* Mod LTI.
*/