diff --git a/awx/ui/static/js/main-menu/default-menu.directive.js b/awx/ui/static/js/main-menu/default-menu.directive.js new file mode 100644 index 0000000000..4e279e515a --- /dev/null +++ b/awx/ui/static/js/main-menu/default-menu.directive.js @@ -0,0 +1,14 @@ +export default function() { + return { + restrict: 'E', + templateUrl: '/static/js/main-menu/menu-default.partial.html', + link: function(scope, element) { + var contents = element.contents(); + contents.unwrap(); + + scope.$on('$destroy', function() { + contents.remove(); + }); + } + }; +} diff --git a/awx/ui/static/js/main-menu/main-menu.block.less b/awx/ui/static/js/main-menu/main-menu.block.less index a2d941aec7..eb054d12a0 100644 --- a/awx/ui/static/js/main-menu/main-menu.block.less +++ b/awx/ui/static/js/main-menu/main-menu.block.less @@ -25,6 +25,10 @@ padding: 0 1rem; } + &-menuContainer { + display: flex; + } + &-toggle { @media screen and (min-width: 571px) { display: none; diff --git a/awx/ui/static/js/main-menu/main-menu.directive.js b/awx/ui/static/js/main-menu/main-menu.directive.js index e3face97a8..f58fbc5884 100644 --- a/awx/ui/static/js/main-menu/main-menu.directive.js +++ b/awx/ui/static/js/main-menu/main-menu.directive.js @@ -1,33 +1,12 @@ /* jshint unused: vars */ -function getMenuStylePartialUrl(style) { - - if (style !== 'default' && style !== 'portal') { - /* jshint ignore:start */ - console.warn('main-menu: "', style, 'is not a valid menu style. Please use "default" or "minimal".'); - /* jshint ignore:end */ - style = 'default'; - } - - return '/static/js/main-menu/menu-' + style + '.partial.html'; -} - -function link(scope, element, attrs) { - scope.$watch(function(scope) { - return scope.$eval(scope.style); - }, function(value) { - scope.menuStylePartialUrl = getMenuStylePartialUrl(value); - }); -} - export default function() { return { restrict: 'E', templateUrl: '/static/js/main-menu/main-menu.partial.html', scope: { - style: '&menuStyle', + menuStyle: '&menuStyle', currentUser: '=' - }, - link: link + } }; } diff --git a/awx/ui/static/js/main-menu/main-menu.partial.html b/awx/ui/static/js/main-menu/main-menu.partial.html index 5ba452fd75..5f87df2245 100644 --- a/awx/ui/static/js/main-menu/main-menu.partial.html +++ b/awx/ui/static/js/main-menu/main-menu.partial.html @@ -1,7 +1,8 @@ -