Skip to content

Commit

Permalink
Merge pull request #795 from nextcloud/backport/587/sidebar-toggle
Browse files Browse the repository at this point in the history
[stable13] Always show sidebar toggle
  • Loading branch information
nickvergessen authored Apr 20, 2018
2 parents 6ed3ccc + eb68579 commit 017f2a8
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 36 deletions.
46 changes: 13 additions & 33 deletions css/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
}

.app-spreed #app-navigation {
padding-top: 46px;
padding-top: 45px;
padding-bottom: 0;
}

Expand Down Expand Up @@ -475,10 +475,6 @@ video {
z-index: 90;
}

#video-fullscreen.public {
top: 89px;
}

#video-fullscreen,
.nameIndicator button,
#app-sidebar-trigger {
Expand Down Expand Up @@ -632,32 +628,6 @@ video {
display: none !important;
}

/* As there is no header in fullscreen the buttons can be moved to the top. */
#app-content:-webkit-full-screen #app-sidebar-trigger {
top: 0;
}
#app-content:-moz-full-screen #app-sidebar-trigger {
top: 0;
}
#app-content:-ms-fullscreen #app-sidebar-trigger {
top: 0;
}
#app-content:fullscreen #app-sidebar-trigger {
top: 0;
}
#app-content:-webkit-full-screen #video-fullscreen {
top: 44px;
}
#app-content:-moz-full-screen #video-fullscreen {
top: 44px;
}
#app-content:-ms-fullscreen #video-fullscreen {
top: 44px;
}
#app-content:fullscreen #video-fullscreen {
top: 44px;
}


.localmediaerror h2 {
color: red;
Expand Down Expand Up @@ -733,8 +703,8 @@ video {
}

#app-sidebar-trigger {
position: fixed;
top: 45px;
position: absolute;
top: 0;
right: 0;
/* Higher than the z-index of the emptycontent */
z-index: 50;
Expand Down Expand Up @@ -792,6 +762,16 @@ video {
background: transparent;
}

/* Correctly position icons below header in public chat. */
#body-public {
#app-sidebar-trigger {
top: 45px;
}
#video-fullscreen {
top: 89px;
}
}

/* As the header is hidden (except for the logo), move the fullscreen button and
* sidebar to the top during calls */
#body-public #app-content:not(.participants-1) #app-sidebar,
Expand Down
18 changes: 15 additions & 3 deletions js/views/sidebarview.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@
*
* In order for the user to be able to open the sidebar when it is closed,
* the SidebarView shows a small icon ("#app-sidebar-trigger") on the right
* border of the document that opens the sidebar when clicked. When the
* sidebar is open the icon is hidden.
* border of the document that opens the sidebar when clicked.
*
* By default the sidebar is disabled, that is, it is closed and can not be
* opened, neither by the user nor programatically. Calling "enable()" will
Expand All @@ -78,7 +77,7 @@
},

events: {
'click @ui.trigger': 'open',
'click @ui.trigger': 'toggle',
'click @ui.sidebar a.close': 'close',
},

Expand All @@ -90,6 +89,7 @@

initialize: function() {
this._enabled = false;
this._open = false;

this._callInfoView = null;

Expand Down Expand Up @@ -126,16 +126,28 @@
this._enabled = false;
},

toggle: function() {
if (!this._open) {
this.open();
} else {
this.close();
}
},

open: function() {
if (!this._enabled) {
return;
}

OC.Apps.showAppSidebar();

this._open = true;
},

close: function() {
OC.Apps.hideAppSidebar();

this._open = false;
},

/**
Expand Down

0 comments on commit 017f2a8

Please sign in to comment.