Skip to content

Commit 7ad3f4a

Browse files
committed
Better comments
1 parent 5b9d3b1 commit 7ad3f4a

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎src/components/structures/RoomSubList.js‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,14 +115,15 @@ var RoomSubList = React.createClass({
115115
});
116116
},
117117

118+
// The dataset elements are added in the RoomList _initAndPositionStickyHeaders method
118119
isHeaderStuck: function() {
119120
var stuck = this.refs.header.dataset.stuck;
120121
return stuck !== undefined && (stuck === "top" || stuck === "bottom");
121122
},
122123

123124
onClick: function(ev) {
124125
if (!this.isHeaderStuck()) {
125-
// Collapse and truncation logic
126+
// The header is not stuck, so the click is to be interpreted as collapse and truncation logic
126127
var isHidden = false;
127128
var isTruncatable = this.props.list.length > TRUNCATE_AT;
128129

@@ -162,6 +163,7 @@ var RoomSubList = React.createClass({
162163
this.props.onShowMoreRooms();
163164
this.props.onHeaderClick(isHidden);
164165
} else {
166+
// The header is stuck, so the click is to be interpreted as a scroll to the header
165167
this.props.onHeaderClick(isHidden, this.refs.header.dataset.originalPosition);
166168
}
167169
},

0 commit comments

Comments
 (0)