From 7ad3f4a5777de02066d7ba237a3e1dc2bd64827e Mon Sep 17 00:00:00 2001 From: wmwragg Date: Fri, 26 Aug 2016 15:53:31 +0100 Subject: [PATCH] Better comments --- src/components/structures/RoomSubList.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/structures/RoomSubList.js b/src/components/structures/RoomSubList.js index cce68b18..488b5491 100644 --- a/src/components/structures/RoomSubList.js +++ b/src/components/structures/RoomSubList.js @@ -115,6 +115,7 @@ var RoomSubList = React.createClass({ }); }, + // The dataset elements are added in the RoomList _initAndPositionStickyHeaders method isHeaderStuck: function() { var stuck = this.refs.header.dataset.stuck; return stuck !== undefined && (stuck === "top" || stuck === "bottom"); @@ -122,7 +123,7 @@ var RoomSubList = React.createClass({ onClick: function(ev) { if (!this.isHeaderStuck()) { - // Collapse and truncation logic + // The header is not stuck, so the click is to be interpreted as collapse and truncation logic var isHidden = false; var isTruncatable = this.props.list.length > TRUNCATE_AT; @@ -162,6 +163,7 @@ var RoomSubList = React.createClass({ this.props.onShowMoreRooms(); this.props.onHeaderClick(isHidden); } else { + // The header is stuck, so the click is to be interpreted as a scroll to the header this.props.onHeaderClick(isHidden, this.refs.header.dataset.originalPosition); } },