From 1644a0eee407ba59ed07927cb41783e5c04f0c18 Mon Sep 17 00:00:00 2001 From: andrewbogott Date: Tue, 5 Apr 2016 08:27:43 -0500 Subject: [PATCH] Add scrolling to the projector selector Adds a scrollbar to the project selector for larger screens. This isn't needed for smaller sizes, as it already scrolls. Co-Authored-By: Rob Cresswell Change-Id: Ib03eafccd4725af94556286f1f541a9e7cde96e4 Closes-Bug: #1498039 --- .../static/dashboard/scss/_variables.scss | 4 ++++ .../static/dashboard/scss/components/_navbar.scss | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/openstack_dashboard/static/dashboard/scss/_variables.scss b/openstack_dashboard/static/dashboard/scss/_variables.scss index c2921cc256..892f3ff0c6 100644 --- a/openstack_dashboard/static/dashboard/scss/_variables.scss +++ b/openstack_dashboard/static/dashboard/scss/_variables.scss @@ -79,3 +79,7 @@ $dropdown-item-padding-horizontal: 20px; // This defines the max-width for a breadcrumb item before it will be truncated $breadcrumb-item-width: 15em !default; + +// This is the max height for the domain/project selector in the top nav. After +// this point, it will scroll. +$context-selector-max-height: calc(99vh - #{$navbar-height}) !default; diff --git a/openstack_dashboard/static/dashboard/scss/components/_navbar.scss b/openstack_dashboard/static/dashboard/scss/components/_navbar.scss index 101ce83725..74bb3cb5e7 100644 --- a/openstack_dashboard/static/dashboard/scss/components/_navbar.scss +++ b/openstack_dashboard/static/dashboard/scss/components/_navbar.scss @@ -43,3 +43,13 @@ padding-right: $padding-small-vertical; padding-left: $padding-small-vertical; } + +// Scrollbar for the project menu on larger screens +// Not needed for smaller screens, as it is already scrollable +// and can be collapsed to access the settings menu etc. +@media(min-width: $screen-sm-min) { + .context-selection { + max-height: $context-selector-max-height; + overflow-y: scroll; + } +}