mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-18 22:57:38 +01:00
refinement for navigation-details default action of UI.
This commit is contained in:
parent
fa55ca01e7
commit
a824b4d77f
@ -99,7 +99,6 @@
|
||||
vm.selectedProject = item;
|
||||
vm.checkProjectMember(vm.selectedProject.ProjectId);
|
||||
vm.isOpen = false;
|
||||
|
||||
$location.search('project_id', vm.selectedProject.ProjectId);
|
||||
}
|
||||
|
||||
|
@ -6,9 +6,9 @@
|
||||
.module('harbor.layout.navigation')
|
||||
.directive('navigationDetails', navigationDetails);
|
||||
|
||||
NavigationDetailsController.$inject = ['$window', '$location', '$scope'];
|
||||
NavigationDetailsController.$inject = ['$window', '$location', '$scope', '$route'];
|
||||
|
||||
function NavigationDetailsController($window, $location, $scope) {
|
||||
function NavigationDetailsController($window, $location, $scope, $route) {
|
||||
var vm = this;
|
||||
|
||||
$scope.$watch('vm.selectedProject', function(current, origin) {
|
||||
@ -48,9 +48,17 @@
|
||||
function link(scope, element, attrs, ctrl) {
|
||||
|
||||
var visited = ctrl.url.substring(1);
|
||||
|
||||
if(visited.indexOf('?') >= 0) {
|
||||
visited = ctrl.url.substring(1, ctrl.url.indexOf('?') - 1);
|
||||
}
|
||||
|
||||
scope.$watch('vm.selectedProject', function(current) {
|
||||
if(current) {
|
||||
element.find('a').removeClass('active');
|
||||
element.find('a:first').addClass('active');
|
||||
}
|
||||
});
|
||||
|
||||
element.find('a[tag*="' + visited + '"]').addClass('active');
|
||||
element.on('click', click);
|
||||
|
Loading…
Reference in New Issue
Block a user