From ff3ad47be72155e7952eec770ff15d36434c8381 Mon Sep 17 00:00:00 2001 From: wmwragg Date: Tue, 30 Aug 2016 10:45:59 +0100 Subject: [PATCH] Code clean up, and better comments, along with z-index fixes for scrollbar and avatar menu --- src/components/structures/RoomSubList.js | 15 +++++---------- .../css/matrix-react-sdk/views/rooms/RoomList.css | 2 +- .../css/vector-web/structures/LeftPanel.css | 1 + .../css/vector-web/structures/RoomSubList.css | 2 +- 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/src/components/structures/RoomSubList.js b/src/components/structures/RoomSubList.js index 81d851dd1..4817218be 100644 --- a/src/components/structures/RoomSubList.js +++ b/src/components/structures/RoomSubList.js @@ -119,7 +119,6 @@ var RoomSubList = React.createClass({ // The dataset elements are added in the RoomList _initAndPositionStickyHeaders method isCollapsableOnClick: function() { var stuck = this.refs.header.dataset.stuck; - var topBottomSticky = this.refs.header.dataset.topBottomSticky; if (this.state.hidden || stuck === undefined || stuck === "none") { return true; } else { @@ -249,11 +248,8 @@ var RoomSubList = React.createClass({ roomNotificationCount: function() { var self = this; - var subListCount = 0; - var subListHighlight = false; - var cli = MatrixClientPeg.get(); - this.props.list.map(function(room) { + return this.props.list.reduce(function(result, room) { var roomNotifState = RoomNotifs.getRoomNotifsState(room.roomId); var highlight = room.getUnreadNotificationCount('highlight') > 0 || self.props.label === 'Invites'; var notificationCount = room.getUnreadNotificationCount(); @@ -263,14 +259,13 @@ var RoomSubList = React.createClass({ const badges = notifBadges || mentionBadges; if (badges) { - subListCount += notificationCount; + result[0] += notificationCount; if (highlight) { - subListHighlight = true; + result[1] = true; } } - }); - - return [subListCount, subListHighlight]; + return result; + }, [0, false]); }, _updateSubListCount: function() { diff --git a/src/skins/vector/css/matrix-react-sdk/views/rooms/RoomList.css b/src/skins/vector/css/matrix-react-sdk/views/rooms/RoomList.css index 06ac885c2..4dcda646f 100644 --- a/src/skins/vector/css/matrix-react-sdk/views/rooms/RoomList.css +++ b/src/skins/vector/css/matrix-react-sdk/views/rooms/RoomList.css @@ -35,5 +35,5 @@ limitations under the License. /* Make sure the scrollbar is above the sticky headers from RoomList */ .mx_RoomList_scrollbar .gm-scrollbar.-vertical { - z-index: 3; + z-index: 5; } diff --git a/src/skins/vector/css/vector-web/structures/LeftPanel.css b/src/skins/vector/css/vector-web/structures/LeftPanel.css index 47f286715..fb023ffea 100644 --- a/src/skins/vector/css/vector-web/structures/LeftPanel.css +++ b/src/skins/vector/css/vector-web/structures/LeftPanel.css @@ -49,6 +49,7 @@ limitations under the License. flex: 1 1 0; overflow-y: auto; + z-index: 5; } .mx_LeftPanel.collapsed .mx_BottomLeftMenu { diff --git a/src/skins/vector/css/vector-web/structures/RoomSubList.css b/src/skins/vector/css/vector-web/structures/RoomSubList.css index 2c1c49a38..4d9b0668f 100644 --- a/src/skins/vector/css/vector-web/structures/RoomSubList.css +++ b/src/skins/vector/css/vector-web/structures/RoomSubList.css @@ -46,7 +46,7 @@ limitations under the License. .mx_RoomSubList_label.mx_RoomSubList_fixed { position: fixed; top: 0; - z-index: 2; + z-index: 4; /* pointer-events: none; */ }