From 9fd87806c25ceeb052215b363582bd23e75f6d2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Calvi=C3=B1o=20S=C3=A1nchez?= Date: Fri, 1 Dec 2017 20:31:25 +0100 Subject: [PATCH] Open sidebar automatically when joining a room MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Below certain window width the sidebar starts overlapping with the content area, so the sidebar is automatically open only if it will not overlap with the content. Signed-off-by: Daniel Calviño Sánchez --- js/app.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/js/app.js b/js/app.js index 783225d1e5f..920d71970c2 100644 --- a/js/app.js +++ b/js/app.js @@ -385,6 +385,16 @@ updateSidebarWithActiveRoom: function() { this._sidebarView.enable(); + // The sidebar has a width of 27% of the window width and a minimum + // width of 300px. Therefore, when the window is 1111px wide or + // narrower the sidebar will always be 300px wide, and when that + // happens it will overlap with the content area (the narrower the + // window the larger the overlap). Due to this the sidebar is opened + // automatically only if it will not overlap with the content area. + if ($(window).width() > 1111) { + this._sidebarView.open(); + } + var callInfoView = new OCA.SpreedMe.Views.CallInfoView({ model: this.activeRoom, guestNameModel: this._localStorageModel