mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 05:58:34 +01:00
MDL-47513 Fix RTL issues with grade report
This commit is contained in:
parent
b1b66a3d12
commit
4a8c380abb
@ -346,6 +346,15 @@ FloatingHeaders.prototype = {
|
||||
*/
|
||||
firstUserCellWidth: 0,
|
||||
|
||||
/**
|
||||
* The width of the dock if it is visible.
|
||||
*
|
||||
* @property dockWidth
|
||||
* @type Number
|
||||
* @protected
|
||||
*/
|
||||
dockWidth: 0,
|
||||
|
||||
/**
|
||||
* The position of the top of the final user cell.
|
||||
* This is used when processing the scroll event as an optimisation. It must be updated when
|
||||
@ -446,6 +455,13 @@ FloatingHeaders.prototype = {
|
||||
this.footerRowPosition = this.tableFooterRow.getY();
|
||||
}
|
||||
|
||||
// Add the width of the dock if it is visible.
|
||||
this.dockWidth = 0;
|
||||
var dock = Y.one('.has_dock #dock');
|
||||
if (dock) {
|
||||
this.dockWidth = dock.get(OFFSETWIDTH);
|
||||
}
|
||||
|
||||
var userCellList = Y.all(SELECTORS.USERCELL);
|
||||
|
||||
// The left of the user cells matches the left of the headerRow.
|
||||
@ -579,7 +595,9 @@ FloatingHeaders.prototype = {
|
||||
// Listen for window scrolls, resizes, and rotation events.
|
||||
Y.one(Y.config.win).on('scroll', this._handleScrollEvent, this),
|
||||
Y.one(Y.config.win).on('resize', this._handleResizeEvent, this),
|
||||
Y.one(Y.config.win).on('orientationchange', this._handleResizeEvent, this)
|
||||
Y.one(Y.config.win).on('orientationchange', this._handleResizeEvent, this),
|
||||
Y.Global.on('dock:shown', this._handleResizeEvent, this),
|
||||
Y.Global.on('dock:hidden', this._handleResizeEvent, this)
|
||||
);
|
||||
},
|
||||
|
||||
@ -594,7 +612,7 @@ FloatingHeaders.prototype = {
|
||||
var userColumn = Y.all(SELECTORS.USERCELL),
|
||||
|
||||
// Create a floating table.
|
||||
floatingUserColumn = Y.Node.create('<div aria-hidden="true" role="presentation" class="floater"></div>'),
|
||||
floatingUserColumn = Y.Node.create('<div aria-hidden="true" role="presentation" class="floater sideonly"></div>'),
|
||||
|
||||
// Get the XY for the floating element.
|
||||
coordinates = this._getRelativeXY(this.firstUserCell);
|
||||
@ -641,7 +659,7 @@ FloatingHeaders.prototype = {
|
||||
this.headerCell = Y.one(SELECTORS.STUDENTHEADER);
|
||||
|
||||
// Create the floating row and cell.
|
||||
var floatingUserHeaderRow = Y.Node.create('<div aria-hidden="true" role="presentation" class="floater heading"></div>'),
|
||||
var floatingUserHeaderRow = Y.Node.create('<div aria-hidden="true" role="presentation" class="floater sideonly heading"></div>'),
|
||||
floatingUserHeaderCell = Y.Node.create('<div></div>'),
|
||||
nodepos = this._getRelativeXY(this.headerCell)[0],
|
||||
coordinates = this._getRelativeXY(this.headerRow),
|
||||
@ -821,7 +839,7 @@ FloatingHeaders.prototype = {
|
||||
}
|
||||
|
||||
// Create the floating row and cell.
|
||||
var floatingRow = Y.Node.create('<div aria-hidden="true" role="presentation" class="floater"></div>'),
|
||||
var floatingRow = Y.Node.create('<div aria-hidden="true" role="presentation" class="floater sideonly"></div>'),
|
||||
floatingCell = Y.Node.create('<div></div>'),
|
||||
coordinates = this._getRelativeXY(origin),
|
||||
width = this.firstUserCell.getComputedStyle(WIDTH),
|
||||
@ -904,14 +922,14 @@ FloatingHeaders.prototype = {
|
||||
|
||||
// User column position.
|
||||
if (right_to_left()) {
|
||||
floatingUserTriggerPoint = Y.config.win.innerWidth + Y.config.win.pageXOffset;
|
||||
floatingUserTriggerPoint = Y.config.win.innerWidth + Y.config.win.pageXOffset - this.dockWidth;
|
||||
floatingUserRelativePoint = floatingUserTriggerPoint - this.firstUserCellWidth;
|
||||
userFloats = floatingUserTriggerPoint < (this.firstUserCellLeft + this.firstUserCellWidth);
|
||||
leftTitleFloats = (floatingUserTriggerPoint - this.firstNonUserCellWidth) <
|
||||
(this.firstNonUserCellLeft + this.firstUserCellWidth);
|
||||
} else {
|
||||
floatingUserTriggerPoint = Y.config.win.pageXOffset;
|
||||
floatingUserRelativePoint = floatingUserTriggerPoint;
|
||||
floatingUserRelativePoint = Y.config.win.pageXOffset;
|
||||
floatingUserTriggerPoint = floatingUserRelativePoint + this.dockWidth;
|
||||
userFloats = floatingUserTriggerPoint > this.firstUserCellLeft;
|
||||
leftTitleFloats = floatingUserTriggerPoint > (this.firstNonUserCellLeft - this.firstUserCellWidth);
|
||||
}
|
||||
|
File diff suppressed because one or more lines are too long
@ -346,6 +346,15 @@ FloatingHeaders.prototype = {
|
||||
*/
|
||||
firstUserCellWidth: 0,
|
||||
|
||||
/**
|
||||
* The width of the dock if it is visible.
|
||||
*
|
||||
* @property dockWidth
|
||||
* @type Number
|
||||
* @protected
|
||||
*/
|
||||
dockWidth: 0,
|
||||
|
||||
/**
|
||||
* The position of the top of the final user cell.
|
||||
* This is used when processing the scroll event as an optimisation. It must be updated when
|
||||
@ -446,6 +455,13 @@ FloatingHeaders.prototype = {
|
||||
this.footerRowPosition = this.tableFooterRow.getY();
|
||||
}
|
||||
|
||||
// Add the width of the dock if it is visible.
|
||||
this.dockWidth = 0;
|
||||
var dock = Y.one('.has_dock #dock');
|
||||
if (dock) {
|
||||
this.dockWidth = dock.get(OFFSETWIDTH);
|
||||
}
|
||||
|
||||
var userCellList = Y.all(SELECTORS.USERCELL);
|
||||
|
||||
// The left of the user cells matches the left of the headerRow.
|
||||
@ -579,7 +595,9 @@ FloatingHeaders.prototype = {
|
||||
// Listen for window scrolls, resizes, and rotation events.
|
||||
Y.one(Y.config.win).on('scroll', this._handleScrollEvent, this),
|
||||
Y.one(Y.config.win).on('resize', this._handleResizeEvent, this),
|
||||
Y.one(Y.config.win).on('orientationchange', this._handleResizeEvent, this)
|
||||
Y.one(Y.config.win).on('orientationchange', this._handleResizeEvent, this),
|
||||
Y.Global.on('dock:shown', this._handleResizeEvent, this),
|
||||
Y.Global.on('dock:hidden', this._handleResizeEvent, this)
|
||||
);
|
||||
},
|
||||
|
||||
@ -594,7 +612,7 @@ FloatingHeaders.prototype = {
|
||||
var userColumn = Y.all(SELECTORS.USERCELL),
|
||||
|
||||
// Create a floating table.
|
||||
floatingUserColumn = Y.Node.create('<div aria-hidden="true" role="presentation" class="floater"></div>'),
|
||||
floatingUserColumn = Y.Node.create('<div aria-hidden="true" role="presentation" class="floater sideonly"></div>'),
|
||||
|
||||
// Get the XY for the floating element.
|
||||
coordinates = this._getRelativeXY(this.firstUserCell);
|
||||
@ -641,7 +659,7 @@ FloatingHeaders.prototype = {
|
||||
this.headerCell = Y.one(SELECTORS.STUDENTHEADER);
|
||||
|
||||
// Create the floating row and cell.
|
||||
var floatingUserHeaderRow = Y.Node.create('<div aria-hidden="true" role="presentation" class="floater heading"></div>'),
|
||||
var floatingUserHeaderRow = Y.Node.create('<div aria-hidden="true" role="presentation" class="floater sideonly heading"></div>'),
|
||||
floatingUserHeaderCell = Y.Node.create('<div></div>'),
|
||||
nodepos = this._getRelativeXY(this.headerCell)[0],
|
||||
coordinates = this._getRelativeXY(this.headerRow),
|
||||
@ -820,7 +838,7 @@ FloatingHeaders.prototype = {
|
||||
}
|
||||
|
||||
// Create the floating row and cell.
|
||||
var floatingRow = Y.Node.create('<div aria-hidden="true" role="presentation" class="floater"></div>'),
|
||||
var floatingRow = Y.Node.create('<div aria-hidden="true" role="presentation" class="floater sideonly"></div>'),
|
||||
floatingCell = Y.Node.create('<div></div>'),
|
||||
coordinates = this._getRelativeXY(origin),
|
||||
width = this.firstUserCell.getComputedStyle(WIDTH),
|
||||
@ -903,14 +921,14 @@ FloatingHeaders.prototype = {
|
||||
|
||||
// User column position.
|
||||
if (right_to_left()) {
|
||||
floatingUserTriggerPoint = Y.config.win.innerWidth + Y.config.win.pageXOffset;
|
||||
floatingUserTriggerPoint = Y.config.win.innerWidth + Y.config.win.pageXOffset - this.dockWidth;
|
||||
floatingUserRelativePoint = floatingUserTriggerPoint - this.firstUserCellWidth;
|
||||
userFloats = floatingUserTriggerPoint < (this.firstUserCellLeft + this.firstUserCellWidth);
|
||||
leftTitleFloats = (floatingUserTriggerPoint - this.firstNonUserCellWidth) <
|
||||
(this.firstNonUserCellLeft + this.firstUserCellWidth);
|
||||
} else {
|
||||
floatingUserTriggerPoint = Y.config.win.pageXOffset;
|
||||
floatingUserRelativePoint = floatingUserTriggerPoint;
|
||||
floatingUserRelativePoint = Y.config.win.pageXOffset;
|
||||
floatingUserTriggerPoint = floatingUserRelativePoint + this.dockWidth;
|
||||
userFloats = floatingUserTriggerPoint > this.firstUserCellLeft;
|
||||
leftTitleFloats = floatingUserTriggerPoint > (this.firstNonUserCellLeft - this.firstUserCellWidth);
|
||||
}
|
||||
|
@ -203,6 +203,15 @@ FloatingHeaders.prototype = {
|
||||
*/
|
||||
firstUserCellWidth: 0,
|
||||
|
||||
/**
|
||||
* The width of the dock if it is visible.
|
||||
*
|
||||
* @property dockWidth
|
||||
* @type Number
|
||||
* @protected
|
||||
*/
|
||||
dockWidth: 0,
|
||||
|
||||
/**
|
||||
* The position of the top of the final user cell.
|
||||
* This is used when processing the scroll event as an optimisation. It must be updated when
|
||||
@ -303,6 +312,13 @@ FloatingHeaders.prototype = {
|
||||
this.footerRowPosition = this.tableFooterRow.getY();
|
||||
}
|
||||
|
||||
// Add the width of the dock if it is visible.
|
||||
this.dockWidth = 0;
|
||||
var dock = Y.one('.has_dock #dock');
|
||||
if (dock) {
|
||||
this.dockWidth = dock.get(OFFSETWIDTH);
|
||||
}
|
||||
|
||||
var userCellList = Y.all(SELECTORS.USERCELL);
|
||||
|
||||
// The left of the user cells matches the left of the headerRow.
|
||||
@ -436,7 +452,9 @@ FloatingHeaders.prototype = {
|
||||
// Listen for window scrolls, resizes, and rotation events.
|
||||
Y.one(Y.config.win).on('scroll', this._handleScrollEvent, this),
|
||||
Y.one(Y.config.win).on('resize', this._handleResizeEvent, this),
|
||||
Y.one(Y.config.win).on('orientationchange', this._handleResizeEvent, this)
|
||||
Y.one(Y.config.win).on('orientationchange', this._handleResizeEvent, this),
|
||||
Y.Global.on('dock:shown', this._handleResizeEvent, this),
|
||||
Y.Global.on('dock:hidden', this._handleResizeEvent, this)
|
||||
);
|
||||
},
|
||||
|
||||
@ -451,7 +469,7 @@ FloatingHeaders.prototype = {
|
||||
var userColumn = Y.all(SELECTORS.USERCELL),
|
||||
|
||||
// Create a floating table.
|
||||
floatingUserColumn = Y.Node.create('<div aria-hidden="true" role="presentation" class="floater"></div>'),
|
||||
floatingUserColumn = Y.Node.create('<div aria-hidden="true" role="presentation" class="floater sideonly"></div>'),
|
||||
|
||||
// Get the XY for the floating element.
|
||||
coordinates = this._getRelativeXY(this.firstUserCell);
|
||||
@ -498,7 +516,7 @@ FloatingHeaders.prototype = {
|
||||
this.headerCell = Y.one(SELECTORS.STUDENTHEADER);
|
||||
|
||||
// Create the floating row and cell.
|
||||
var floatingUserHeaderRow = Y.Node.create('<div aria-hidden="true" role="presentation" class="floater heading"></div>'),
|
||||
var floatingUserHeaderRow = Y.Node.create('<div aria-hidden="true" role="presentation" class="floater sideonly heading"></div>'),
|
||||
floatingUserHeaderCell = Y.Node.create('<div></div>'),
|
||||
nodepos = this._getRelativeXY(this.headerCell)[0],
|
||||
coordinates = this._getRelativeXY(this.headerRow),
|
||||
@ -678,7 +696,7 @@ FloatingHeaders.prototype = {
|
||||
}
|
||||
|
||||
// Create the floating row and cell.
|
||||
var floatingRow = Y.Node.create('<div aria-hidden="true" role="presentation" class="floater"></div>'),
|
||||
var floatingRow = Y.Node.create('<div aria-hidden="true" role="presentation" class="floater sideonly"></div>'),
|
||||
floatingCell = Y.Node.create('<div></div>'),
|
||||
coordinates = this._getRelativeXY(origin),
|
||||
width = this.firstUserCell.getComputedStyle(WIDTH),
|
||||
@ -761,14 +779,14 @@ FloatingHeaders.prototype = {
|
||||
|
||||
// User column position.
|
||||
if (right_to_left()) {
|
||||
floatingUserTriggerPoint = Y.config.win.innerWidth + Y.config.win.pageXOffset;
|
||||
floatingUserTriggerPoint = Y.config.win.innerWidth + Y.config.win.pageXOffset - this.dockWidth;
|
||||
floatingUserRelativePoint = floatingUserTriggerPoint - this.firstUserCellWidth;
|
||||
userFloats = floatingUserTriggerPoint < (this.firstUserCellLeft + this.firstUserCellWidth);
|
||||
leftTitleFloats = (floatingUserTriggerPoint - this.firstNonUserCellWidth) <
|
||||
(this.firstNonUserCellLeft + this.firstUserCellWidth);
|
||||
} else {
|
||||
floatingUserTriggerPoint = Y.config.win.pageXOffset;
|
||||
floatingUserRelativePoint = floatingUserTriggerPoint;
|
||||
floatingUserRelativePoint = Y.config.win.pageXOffset;
|
||||
floatingUserTriggerPoint = floatingUserRelativePoint + this.dockWidth;
|
||||
userFloats = floatingUserTriggerPoint > this.firstUserCellLeft;
|
||||
leftTitleFloats = floatingUserTriggerPoint > (this.firstNonUserCellLeft - this.firstUserCellWidth);
|
||||
}
|
||||
|
@ -341,12 +341,12 @@ DOCK.prototype = {
|
||||
* Fires after the dock has been changed from hidden to visible.
|
||||
* @event dock:shown
|
||||
*/
|
||||
this.publish('dock:shown', {prefix:'dock'});
|
||||
this.publish('dock:shown', {prefix:'dock', broadcast: 2});
|
||||
/**
|
||||
* Fired after the dock has been changed from visible to hidden.
|
||||
* @event dock:hidden
|
||||
*/
|
||||
this.publish('dock:hidden', {prefix:'dock'});
|
||||
this.publish('dock:hidden', {prefix:'dock', broadcast: 2});
|
||||
/**
|
||||
* Fires when an item is added to the dock.
|
||||
* @event dock:itemadded
|
||||
@ -362,7 +362,7 @@ DOCK.prototype = {
|
||||
* This happens after the itemadded and itemremoved events have been called.
|
||||
* @event dock:itemschanged
|
||||
*/
|
||||
this.publish('dock:itemschanged', {prefix:'dock'});
|
||||
this.publish('dock:itemschanged', {prefix:'dock', broadcast: 2});
|
||||
/**
|
||||
* Fires once when the docks panel is first initialised.
|
||||
* @event dock:panelgenerated
|
||||
|
File diff suppressed because one or more lines are too long
@ -339,12 +339,12 @@ DOCK.prototype = {
|
||||
* Fires after the dock has been changed from hidden to visible.
|
||||
* @event dock:shown
|
||||
*/
|
||||
this.publish('dock:shown', {prefix:'dock'});
|
||||
this.publish('dock:shown', {prefix:'dock', broadcast: 2});
|
||||
/**
|
||||
* Fired after the dock has been changed from visible to hidden.
|
||||
* @event dock:hidden
|
||||
*/
|
||||
this.publish('dock:hidden', {prefix:'dock'});
|
||||
this.publish('dock:hidden', {prefix:'dock', broadcast: 2});
|
||||
/**
|
||||
* Fires when an item is added to the dock.
|
||||
* @event dock:itemadded
|
||||
@ -360,7 +360,7 @@ DOCK.prototype = {
|
||||
* This happens after the itemadded and itemremoved events have been called.
|
||||
* @event dock:itemschanged
|
||||
*/
|
||||
this.publish('dock:itemschanged', {prefix:'dock'});
|
||||
this.publish('dock:itemschanged', {prefix:'dock', broadcast: 2});
|
||||
/**
|
||||
* Fires once when the docks panel is first initialised.
|
||||
* @event dock:panelgenerated
|
||||
|
6
lib/yui/src/dock/js/dock.js
vendored
6
lib/yui/src/dock/js/dock.js
vendored
@ -339,12 +339,12 @@ DOCK.prototype = {
|
||||
* Fires after the dock has been changed from hidden to visible.
|
||||
* @event dock:shown
|
||||
*/
|
||||
this.publish('dock:shown', {prefix:'dock'});
|
||||
this.publish('dock:shown', {prefix:'dock', broadcast: 2});
|
||||
/**
|
||||
* Fired after the dock has been changed from visible to hidden.
|
||||
* @event dock:hidden
|
||||
*/
|
||||
this.publish('dock:hidden', {prefix:'dock'});
|
||||
this.publish('dock:hidden', {prefix:'dock', broadcast: 2});
|
||||
/**
|
||||
* Fires when an item is added to the dock.
|
||||
* @event dock:itemadded
|
||||
@ -360,7 +360,7 @@ DOCK.prototype = {
|
||||
* This happens after the itemadded and itemremoved events have been called.
|
||||
* @event dock:itemschanged
|
||||
*/
|
||||
this.publish('dock:itemschanged', {prefix:'dock'});
|
||||
this.publish('dock:itemschanged', {prefix:'dock', broadcast: 2});
|
||||
/**
|
||||
* Fires once when the docks panel is first initialised.
|
||||
* @event dock:panelgenerated
|
||||
|
@ -460,3 +460,33 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.has_dock.path-grade-report-grader {
|
||||
.gradeparent .sideonly.floating > .cell,
|
||||
.gradeparent .sideonly.floating > .cell,
|
||||
.gradeparent .sideonly.floating > .cell {
|
||||
padding-left: 5 + (@dockWidth + (@dockTitleMargin * 2));
|
||||
}
|
||||
|
||||
&.dir-rtl {
|
||||
.gradeparent .sideonly.floating > .cell,
|
||||
.gradeparent .sideonly.floating > .cell,
|
||||
.gradeparent .sideonly.floating > .cell {
|
||||
padding-left: 5px;
|
||||
padding-right: 5 + (@dockWidth + (@dockTitleMargin * 2));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.content-only.path-grade-report-grader {
|
||||
.gradeparent table {
|
||||
margin-left: (@dockWidth + (@dockTitleMargin * 2));
|
||||
}
|
||||
|
||||
&.dir-rtl {
|
||||
.gradeparent table {
|
||||
margin-left: 0;
|
||||
margin-right: (@dockWidth + (@dockTitleMargin * 2));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user