diff --git a/awx/ui/client/legacy/styles/ansible-ui.less b/awx/ui/client/legacy/styles/ansible-ui.less index 69655219b7..b05aa51148 100644 --- a/awx/ui/client/legacy/styles/ansible-ui.less +++ b/awx/ui/client/legacy/styles/ansible-ui.less @@ -2327,4 +2327,4 @@ body { .btn { text-transform: uppercase; -} +} \ 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..78e7bf42b6 100644 --- a/awx/ui/client/lib/components/layout/_index.less +++ b/awx/ui/client/lib/components/layout/_index.less @@ -84,7 +84,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 +93,12 @@ z-index: @at-z-index-side-nav; .at-Layout-sideNavItem { + background: inherit; + color: @at-color-side-nav-content; display: flex; cursor: pointer; text-transform: uppercase; - > i.fa { padding-left: 20px; } @@ -123,6 +123,7 @@ } .at-Layout-sideNavSpacer { + background: inherit; height: @at-height-side-nav-spacer; } @@ -173,3 +174,45 @@ } } } + +@breakpoint-sm: 700px; + +@media screen and (max-width: @breakpoint-sm) { + .at-Layout { + &-side { + top: 60px; + background-color: transparent; + + .at-Layout-sideNavItem.at-Layout-sideNavToggle { + display: flex; + height: 40px; + align-items: center; + width: 55px; + } + + .at-Layout-sideNavItem, + .at-Layout-sideNavSpacer { + display: none; + background-color: @at-color-side-nav-background; + } + + &--expanded { + width: 100vw; + z-index: @at-z-index-side-nav; + + .at-Layout-sideNavItem, + .at-Layout-sideNavSpacer { + display: flex; + } + } + } + + .at-Layout-main { + padding-left: 0; + + #content-container { + padding-top: 100px; + } + } + } +} \ No newline at end of file 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..85ee926cec 100644 --- a/awx/ui/client/lib/components/layout/side-nav.directive.js +++ b/awx/ui/client/lib/components/layout/side-nav.directive.js @@ -2,18 +2,39 @@ const templateUrl = require('~components/layout/side-nav.partial.html'); function atSideNavLink (scope, element, attrs, ctrl) { scope.layoutVm = ctrl; + + document.on('click', (e) => { + if ($(e.target).parents('.at-Layout-side').length === 0) { + scope.$emit('clickOutsideSideNav'); + } + }); } -function AtSideNavController () { - const vm = this || {}; +function AtSideNavController ($scope, $window) { + let vm = this || {}; + const breakpoint = 700; vm.isExpanded = false; vm.toggleExpansion = () => { vm.isExpanded = !vm.isExpanded; }; + + $scope.$watch('layoutVm.currentState', () => { + if ($window.innerWidth <= breakpoint) { + vm.isExpanded = false; + } + }); + + $scope.$on('clickOutsideSideNav', () => { + if ($window.innerWidth <= breakpoint) { + vm.isExpanded = false; + } + }); } +AtSideNavController.$inject = ['$scope', '$window']; + function atSideNav () { return { restrict: 'E', 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 @@