Skip to content

Commit

Permalink
Hide left sidebar if no navitems present
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalwengerter committed May 25, 2021
1 parent a1fbd67 commit fb16acc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
7 changes: 7 additions & 0 deletions changelog/unreleased/enhancement-hide-navbar-if-no-navitems
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Enhancement: Hide left sidebar if no navitems are present

For extensions / pages without nav items and public link pages,
we now hide the left sidebar to not confuse screen readers and
give more screen space for the content.

https://github.com/owncloud/web/pull/5149
9 changes: 8 additions & 1 deletion packages/web-runtime/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</template>
<div v-else id="web-content" key="core-content" class="uk-flex uk-flex-stretch">
<transition :name="appNavigationAnimation">
<focus-trap v-if="isSidebarVisible" :active="isSidebarFixed && appNavigationVisible">
<focus-trap v-if="isSidebarVisible && isSidebarItems" :active="isSidebarFixed && appNavigationVisible">
<oc-sidebar-nav
v-show="isSidebarVisible"
id="web-nav-sidebar"
Expand Down Expand Up @@ -220,6 +220,13 @@ export default {
return 'uk-visible@l'
},
isSidebarItems() {
if (this.sidebarNavItems.length === 0) {
return false
}
return true
},
isSidebarFixed() {
return this.windowWidth <= 960
},
Expand Down

0 comments on commit fb16acc

Please sign in to comment.