Commit 1572a392 authored by Damyon Wiese's avatar Damyon Wiese
Browse files

MDL-56768 boost: Special positioning for grader report

Grader report has custom overflow handling which does not cope with a
scrollable content region. So we need to make the content region flow
weirdly out to the right of the page, and push the blocks underneath -
even on really wide screens where it looks bad. We also needed to
upgrade the custom scroll code to handle the margin on the body
changing.
parent 258d07d3
......@@ -243,6 +243,15 @@ FloatingHeaders.prototype = {
*/
_eventHandles: [],
/**
* The last value of the bodyMargin style. We need to recompute positions if it is changed.
*
* @property lastBodyMargin
* @type Number
* @protected
*/
lastBodyMargin: 0,
/**
* Setup the grader report table.
*
......@@ -775,7 +784,19 @@ FloatingHeaders.prototype = {
leftTitleFloats = false,
floatingHeaderStyles = {},
floatingFooterTitleStyles = {},
floatingFooterTitleRow = false;
floatingFooterTitleRow = false,
bodyMargin = 0;
if (window.right_to_left()) {
bodyMargin = parseInt(Y.one(Y.config.doc.body).getComputedStyle('marginRight'), 10);
} else {
bodyMargin = parseInt(Y.one(Y.config.doc.body).getComputedStyle('marginLeft'), 10);
}
if (bodyMargin != this.lastBodyMargin) {
// Recalculate the position of the edge cells for scroll positioning.
this._calculateCellPositions();
}
// Header position.
gradeItemHeadingContainerStyles.left = this._getRelativeXFromX(this.headerRow.getX());
......@@ -798,15 +819,16 @@ FloatingHeaders.prototype = {
}
// User column position.
if (window.right_to_left()) {
floatingUserTriggerPoint = Y.config.win.innerWidth + Y.config.win.pageXOffset - this.dockWidth;
floatingUserRelativePoint = floatingUserTriggerPoint - this.firstUserCellWidth;
userFloats = floatingUserTriggerPoint < (this.firstUserCellLeft + this.firstUserCellWidth);
floatingUserRelativePoint = floatingUserTriggerPoint - this.firstUserCellWidth - bodyMargin;
userFloats = floatingUserTriggerPoint < (this.firstUserCellLeft + this.firstUserCellWidth + bodyMargin);
leftTitleFloats = (floatingUserTriggerPoint - this.firstNonUserCellWidth) <
(this.firstNonUserCellLeft + this.firstUserCellWidth);
} else {
floatingUserRelativePoint = Y.config.win.pageXOffset;
floatingUserTriggerPoint = floatingUserRelativePoint + this.dockWidth;
floatingUserRelativePoint = Y.config.win.pageXOffset + bodyMargin;
floatingUserTriggerPoint = floatingUserRelativePoint + this.dockWidth + bodyMargin;
userFloats = floatingUserTriggerPoint > this.firstUserCellLeft;
leftTitleFloats = floatingUserTriggerPoint > (this.firstNonUserCellLeft - this.firstUserCellWidth);
}
......
......@@ -27,7 +27,22 @@
}
.path-grade-report #maincontent + .urlselect {
float: right;
position: absolute;
left: 40vw;
}
.path-grade-report-grader {
#region-main {
width: auto;
& > .card {
width: auto;
overflow-x: initial;
}
}
[data-region="blocks-column"] {
width: 100%;
clear: both;
}
}
// Rubrics
......
Supports Markdown
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