Skip to content

Commit

Permalink
Open sidebar automatically when joining a room
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
danxuliu committed Dec 1, 2017
1 parent b6d8532 commit 9fd8780
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9fd8780

Please sign in to comment.