Better comments

pull/2028/head
wmwragg 2016-08-26 15:53:31 +01:00
parent 5b9d3b119f
commit 7ad3f4a577
1 changed files with 3 additions and 1 deletions

View File

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