Fixed incorrect init calculation of originalPosition attribute
parent
73dd05b01d
commit
7631539584
|
@ -320,6 +320,8 @@ module.exports = React.createClass({
|
|||
|
||||
_initAndPositionStickyHeaders: function(initialise, scrollToPosition) {
|
||||
var scrollArea = this._getScrollNode();
|
||||
// Use the offset of the top of the scroll area from the window
|
||||
// as this is used to calculate the CSS fixed top position for the stickies
|
||||
var scrollAreaOffset = scrollArea.getBoundingClientRect().top;
|
||||
var scrollAreaHeight = scrollArea.getBoundingClientRect().height;
|
||||
|
||||
|
@ -335,7 +337,11 @@ module.exports = React.createClass({
|
|||
if (typeof stickies === "object" && stickies.length > 0) {
|
||||
// Initialise the sticky headers
|
||||
this.stickyWrappers = Array.prototype.map.call(stickies, function(sticky, i) {
|
||||
sticky.dataset.originalPosition = sticky.offsetTop - scrollAreaOffset;
|
||||
// Save the positions of all the stickies within scroll area.
|
||||
// These positions are relative to the LHS Panel top
|
||||
sticky.dataset.originalPosition = sticky.offsetTop - scrollArea.offsetTop;
|
||||
|
||||
// Save and set the sticky heights
|
||||
var originalHeight = sticky.getBoundingClientRect().height;
|
||||
sticky.dataset.originalHeight = originalHeight;
|
||||
sticky.style.height = originalHeight;
|
||||
|
|
Loading…
Reference in New Issue