diff --git a/awx/ui/client/legacy/styles/ansible-ui.less b/awx/ui/client/legacy/styles/ansible-ui.less index 69655219b7..c66fff4412 100644 --- a/awx/ui/client/legacy/styles/ansible-ui.less +++ b/awx/ui/client/legacy/styles/ansible-ui.less @@ -2328,3 +2328,11 @@ body { .btn { text-transform: uppercase; } + +@breakpoint-sm: 700px; + +@media screen and (max-width: @breakpoint-sm) { + #content-container { + padding-top: 100px; + } +} \ No newline at end of file diff --git a/awx/ui/client/lib/components/layout/_index.less b/awx/ui/client/lib/components/layout/_index.less index 1a351d6bfd..64b07eda2c 100644 --- a/awx/ui/client/lib/components/layout/_index.less +++ b/awx/ui/client/lib/components/layout/_index.less @@ -83,8 +83,6 @@ } &-side { - background: @at-color-side-nav-background; - color: @at-color-side-nav-content; position: fixed; bottom: 0; top: @at-height-top-side-nav-makeup; @@ -94,11 +92,12 @@ z-index: @at-z-index-side-nav; .at-Layout-sideNavItem { + background: @at-color-side-nav-background; + color: @at-color-side-nav-content; display: flex; cursor: pointer; text-transform: uppercase; - > i.fa { padding-left: 20px; } @@ -124,6 +123,7 @@ .at-Layout-sideNavSpacer { height: @at-height-side-nav-spacer; + background: @at-color-side-nav-background; } &--expanded { @@ -173,3 +173,40 @@ } } } + + +@breakpoint-sm: 700px; + +@media screen and (max-width: @breakpoint-sm) { + .at-Layout { + &-side { + top: 60px; + + .at-Layout-sideNavItem.at-Layout-sideNavToggle { + display: flex; + height: 40px; + align-items: center; + width: 55px; + } + + .at-Layout-sideNavItem, + .at-Layout-sideNavSpacer { + display: none; + } + + &--expanded { + width: 100vw; + z-index: @at-z-index-side-nav; + + .at-Layout-sideNavItem, + .at-Layout-sideNavSpacer { + display: flex; + } + } + } + + .at-Layout-main { + padding-left: 0; + } + } +} diff --git a/awx/ui/client/lib/components/layout/side-nav.directive.js b/awx/ui/client/lib/components/layout/side-nav.directive.js index 2b47d7a7da..e819549e83 100644 --- a/awx/ui/client/lib/components/layout/side-nav.directive.js +++ b/awx/ui/client/lib/components/layout/side-nav.directive.js @@ -4,14 +4,24 @@ function atSideNavLink (scope, element, attrs, ctrl) { scope.layoutVm = ctrl; } -function AtSideNavController () { - const vm = this || {}; +function AtSideNavController ($scope) { + let vm = this || {}; vm.isExpanded = false; vm.toggleExpansion = () => { vm.isExpanded = !vm.isExpanded; - }; + } + + document.body.onclick = (e) => { + if ($(e.target).parents(".at-Layout-side").length === 0) { + vm.isExpanded = false; + } + } + + $scope.$on('$locationChangeStart', function(event) { + vm.isExpanded = false; + }); } function atSideNav () { diff --git a/awx/ui/client/lib/components/layout/side-nav.partial.html b/awx/ui/client/lib/components/layout/side-nav.partial.html index c7e5130ef4..8996df899f 100644 --- a/awx/ui/client/lib/components/layout/side-nav.partial.html +++ b/awx/ui/client/lib/components/layout/side-nav.partial.html @@ -1,6 +1,6 @@