MDL-46951 gradereport_grader: Handling of user cells when resizing

For some reason, the max-width/min-width/width of the table cell containing
the name of the users did not work, leading to very large columns but a very
narrow floating one. Handling the size of those columsn upon resize was
also necessary after with this fix.

This issue is a part of the MDL-46658 Task.
This issue is a part of the MDL-25544 Epic.
This commit is contained in:
Frederic Massart 2014-08-26 15:04:29 +08:00 committed by Andrew Nicols
parent b6ad809581
commit 1da29869aa
5 changed files with 34 additions and 2 deletions

View File

@ -79,7 +79,6 @@
.gradeparent th.user {
padding: 4px;
min-width: 200px;
max-width: 200px;
width: 200px;
border-color: #666666;
border-right-width: 1px;

View File

@ -887,6 +887,17 @@ FloatingHeaders.prototype = {
// Simulate a scroll.
this._handleScrollEvent();
// Resize user cells.
var userWidth = this.firstUserCell.getComputedStyle(WIDTH);
var userCells = Y.all(SELECTORS.USERCELL);
this.userColumnHeader.setStyle('width', userWidth);
this.userColumn.all('.gradebook-user-cell').each(function(cell, idx) {
cell.setStyles({
width: userWidth,
height: userCells.item(idx).getComputedStyle(HEIGHT)
});
}, this);
// Resize headers & footers.
// This is an expensive operation, not expected to happen often.
var headers = this.gradeItemHeadingContainer.all(SELECTORS.HEADERCELL);

View File

@ -886,6 +886,17 @@ FloatingHeaders.prototype = {
// Simulate a scroll.
this._handleScrollEvent();
// Resize user cells.
var userWidth = this.firstUserCell.getComputedStyle(WIDTH);
var userCells = Y.all(SELECTORS.USERCELL);
this.userColumnHeader.setStyle('width', userWidth);
this.userColumn.all('.gradebook-user-cell').each(function(cell, idx) {
cell.setStyles({
width: userWidth,
height: userCells.item(idx).getComputedStyle(HEIGHT)
});
}, this);
// Resize headers & footers.
// This is an expensive operation, not expected to happen often.
var headers = this.gradeItemHeadingContainer.all(SELECTORS.HEADERCELL);

View File

@ -639,6 +639,17 @@ FloatingHeaders.prototype = {
// Simulate a scroll.
this._handleScrollEvent();
// Resize user cells.
var userWidth = this.firstUserCell.getComputedStyle(WIDTH);
var userCells = Y.all(SELECTORS.USERCELL);
this.userColumnHeader.setStyle('width', userWidth);
this.userColumn.all('.gradebook-user-cell').each(function(cell, idx) {
cell.setStyles({
width: userWidth,
height: userCells.item(idx).getComputedStyle(HEIGHT)
});
}, this);
// Resize headers & footers.
// This is an expensive operation, not expected to happen often.
var headers = this.gradeItemHeadingContainer.all(SELECTORS.HEADERCELL);