From d30ff13c18980bc59e88a0327657086e3350ee8c Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Mon, 4 Feb 2019 15:09:44 +0000 Subject: [PATCH 1/2] pass the layout to the resizer as a lamba to avoid having the wrong layout when filtering --- src/components/views/rooms/RoomList.js | 2 +- src/resizer/distributors/roomsublist2.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/views/rooms/RoomList.js b/src/components/views/rooms/RoomList.js index bbfc4649d2..0d37cca996 100644 --- a/src/components/views/rooms/RoomList.js +++ b/src/components/views/rooms/RoomList.js @@ -183,7 +183,7 @@ module.exports = React.createClass({ componentDidMount: function() { this.dispatcherRef = dis.register(this.onAction); const cfg = { - layout: this._layout, + layout: () => this._layout, }; this.resizer = new Resizer(this.resizeContainer, Distributor, cfg); this.resizer.setClassNames({ diff --git a/src/resizer/distributors/roomsublist2.js b/src/resizer/distributors/roomsublist2.js index e70e6893c6..9970a22dd2 100644 --- a/src/resizer/distributors/roomsublist2.js +++ b/src/resizer/distributors/roomsublist2.js @@ -320,7 +320,7 @@ export class Distributor extends FixedDistributor { constructor(item, cfg) { super(item); const layout = cfg.layout; - this._handle = layout.openHandle(item.id); + this._handle = layout().openHandle(item.id); } finish() { From f029aad9fa887e8dcb225ee0990a968162b4ebc3 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Mon, 4 Feb 2019 18:38:31 +0000 Subject: [PATCH 2/2] rename to getLayout --- src/components/views/rooms/RoomList.js | 2 +- src/resizer/distributors/roomsublist2.js | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/components/views/rooms/RoomList.js b/src/components/views/rooms/RoomList.js index 0d37cca996..534988922f 100644 --- a/src/components/views/rooms/RoomList.js +++ b/src/components/views/rooms/RoomList.js @@ -183,7 +183,7 @@ module.exports = React.createClass({ componentDidMount: function() { this.dispatcherRef = dis.register(this.onAction); const cfg = { - layout: () => this._layout, + getLayout: () => this._layout, }; this.resizer = new Resizer(this.resizeContainer, Distributor, cfg); this.resizer.setClassNames({ diff --git a/src/resizer/distributors/roomsublist2.js b/src/resizer/distributors/roomsublist2.js index 9970a22dd2..a715087630 100644 --- a/src/resizer/distributors/roomsublist2.js +++ b/src/resizer/distributors/roomsublist2.js @@ -319,8 +319,7 @@ class Handle { export class Distributor extends FixedDistributor { constructor(item, cfg) { super(item); - const layout = cfg.layout; - this._handle = layout().openHandle(item.id); + this._handle = cfg.getLayout().openHandle(item.id); } finish() {