MDL-18228 Added a bit of JS to resize the left header of the fixed student column. This should help to keep the rows below aligned.

This commit is contained in:
nicolasconnault
2009-07-03 06:31:49 +00:00
parent c211a14454
commit 362b69f088
2 changed files with 8 additions and 2 deletions
+7 -1
View File
@@ -205,6 +205,12 @@ echo '<div id="hiddentooltiproot">tooltip panel</div>';
YAHOO.namespace("graderreport");
function init() {
// Adjust height of header c0
var rows = document.getElementsByClassName('heading_name_row');
var header_cell_region = YAHOO.util.Dom.getRegion(rows[rows.length-1].firstChild);
var height = header_cell_region.bottom - header_cell_region.top;
YAHOO.util.Dom.setStyle('studentheader', 'height', height + 'px');
// attach event listener to the table for mouseover and mouseout
var table = document.getElementById('user-grades');
YAHOO.util.Event.on(table, 'mouseover', YAHOO.graderreport.mouseoverHandler);
@@ -224,7 +230,6 @@ function init() {
YAHOO.graderreport.panelEl.render(table);
document.body.className += ' yui-skin-sam';
}
YAHOO.graderreport.mouseoverHandler = function (e) {
@@ -343,6 +348,7 @@ YAHOO.graderreport.mouseoutHandler = function (e) {
YAHOO.util.Event.onDOMReady(init);
//]]>
</script>
<?php
+1 -1
View File
@@ -980,7 +980,7 @@ class grade_report_grader extends grade_report {
';
}
$studentshtml .= '<tr class="heading"><th class="header c0" scope="col"><a href="'.$this->baseurl.'&amp;sortitemid=firstname">'
$studentshtml .= '<tr class="heading"><th id="studentheader" class="header c0" scope="col"><a href="'.$this->baseurl.'&amp;sortitemid=firstname">'
. $strfirstname . '</a> '
. $firstarrow. '/ <a href="'.$this->baseurl.'&amp;sortitemid=lastname">' . $strlastname . '</a>'. $lastarrow .'</th>';