Merge branch 'MDL-47513-master' of git://github.com/andrewnicols/moodle

This commit is contained in:
Dan Poltawski 2014-10-23 16:17:49 +01:00 committed by Eloy Lafuente (stronk7)
commit 276af2a44d
10 changed files with 121 additions and 37 deletions

View file

@ -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);
}

View file

@ -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);
}

View file

@ -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);
}