From 8f7d3394e668e8e51617e3e1627883508ec00f8a Mon Sep 17 00:00:00 2001 From: wmwragg Date: Sun, 28 Aug 2016 12:02:20 +0100 Subject: [PATCH] Always setup stickies, even if we aren't going to use them so that the following map can fire --- src/components/views/rooms/RoomList.js | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/src/components/views/rooms/RoomList.js b/src/components/views/rooms/RoomList.js index 9f10d51d82..96db9dd853 100644 --- a/src/components/views/rooms/RoomList.js +++ b/src/components/views/rooms/RoomList.js @@ -333,22 +333,20 @@ module.exports = React.createClass({ this.scrollAreaSufficient = (120 + (stickies[0].getBoundingClientRect().height * stickies.length)) < scrollAreaHeight; // Initialise the sticky headers - if (this.scrollAreaSufficient) { - if (typeof stickies === "object" && stickies.length > 0) { - // Initialise the sticky headers - this.stickyWrappers = Array.prototype.map.call(stickies, function(sticky, i) { - // 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; + if (typeof stickies === "object" && stickies.length > 0) { + // Initialise the sticky headers + this.stickyWrappers = Array.prototype.map.call(stickies, function(sticky, i) { + // 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; + // Save and set the sticky heights + var originalHeight = sticky.getBoundingClientRect().height; + sticky.dataset.originalHeight = originalHeight; + sticky.style.height = originalHeight; - return sticky; - }); - } + return sticky; + }); } }