From 35523260036b3e3bc64d3f9e51e08ff0508f6d40 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Wed, 17 Oct 2018 16:20:38 +0200 Subject: [PATCH 1/4] more lint fixes --- src/Tinter.js | 2 +- src/components/structures/TopLeftMenu.js | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Tinter.js b/src/Tinter.js index cd87d31ca8..de9ae94097 100644 --- a/src/Tinter.js +++ b/src/Tinter.js @@ -155,7 +155,7 @@ class Tinter { tint(primaryColor, secondaryColor, tertiaryColor) { return; - + // eslint-disable-next-line no-unreachable this.currentTint[0] = primaryColor; this.currentTint[1] = secondaryColor; this.currentTint[2] = tertiaryColor; diff --git a/src/components/structures/TopLeftMenu.js b/src/components/structures/TopLeftMenu.js index 586a88666e..5dfa8ed171 100644 --- a/src/components/structures/TopLeftMenu.js +++ b/src/components/structures/TopLeftMenu.js @@ -17,7 +17,6 @@ limitations under the License. import React from 'react'; import PropTypes from 'prop-types'; import sdk from '../../index'; -import dis from '../../dispatcher'; class TopLeftMenu extends React.Component { @@ -30,7 +29,7 @@ class TopLeftMenu extends React.Component { render() { const BaseAvatar = sdk.getComponent('avatars.BaseAvatar'); const avatarHeight = 28; - const name = "My stuff" + const name = "My stuff"; return (
@@ -43,10 +42,10 @@ class TopLeftMenu extends React.Component {
{ name }
- +
); } } -module.exports = TopLeftMenu; \ No newline at end of file +module.exports = TopLeftMenu; From bfbf41f4311079ef923dac9c504c27c11562f2cd Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Fri, 19 Oct 2018 12:09:15 +0200 Subject: [PATCH 2/4] make scrollable room list grab available space without this, in small sizes, it would make the header shrink. --- res/css/structures/_RoomSubList.scss | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/res/css/structures/_RoomSubList.scss b/res/css/structures/_RoomSubList.scss index baecc62b2a..4661913b1e 100644 --- a/res/css/structures/_RoomSubList.scss +++ b/res/css/structures/_RoomSubList.scss @@ -131,6 +131,11 @@ limitations under the License. transform: rotateZ(-90deg); } +.mx_RoomSubList .gm-scrollbar-container { + /* let rooms list grab all available space */ + flex: 1; +} + .collapsed { .mx_RoomSubList_label { height: 17px; From eb1ee1ca5550dccd4c3a02c93815cd32409518e5 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Fri, 19 Oct 2018 15:15:49 +0200 Subject: [PATCH 3/4] bind instead of second member var --- src/resizer/resizer.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/resizer/resizer.js b/src/resizer/resizer.js index f207f4a215..c5112e5139 100644 --- a/src/resizer/resizer.js +++ b/src/resizer/resizer.js @@ -40,7 +40,7 @@ export class Resizer { vertical: "resizer-vertical", resizing: "resizer-resizing", }; - this.mouseDownHandler = (event) => this._onMouseDown(event); + this._onMouseDown = this._onMouseDown.bind(this); } setClassNames(classNames) { @@ -48,11 +48,11 @@ export class Resizer { } attach() { - this.container.addEventListener("mousedown", this.mouseDownHandler, false); + this.container.addEventListener("mousedown", this._onMouseDown, false); } detach() { - this.container.removeEventListener("mousedown", this.mouseDownHandler, false); + this.container.removeEventListener("mousedown", this._onMouseDown, false); } /** From 7ece134b4e620e2ffab4414cc28e071e35a4bb98 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Fri, 19 Oct 2018 15:22:28 +0200 Subject: [PATCH 4/4] dont cause rerender with anon func --- src/components/structures/LoggedInView.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/structures/LoggedInView.js b/src/components/structures/LoggedInView.js index db600abbf2..9d5f54d338 100644 --- a/src/components/structures/LoggedInView.js +++ b/src/components/structures/LoggedInView.js @@ -412,6 +412,10 @@ const LoggedInView = React.createClass({ this.setState({mouseDown: null}); }, + _setResizeContainerRef(div) { + this.resizeContainer = div; + }, + render: function() { const LeftPanel = sdk.getComponent('structures.LeftPanel'); const RightPanel = sdk.getComponent('structures.RightPanel'); @@ -558,7 +562,7 @@ const LoggedInView = React.createClass({
{ topBar } -
this.resizeContainer = div} className={bodyClasses}> +