Add support for having the 'namespace' URL param override the cookie in the namespace selector

This commit is contained in:
Joseph Schorr 2013-11-08 15:58:21 -05:00
parent 5f097c45ca
commit 9f7b1347ef

View file

@ -728,7 +728,7 @@ quayApp.directive('namespaceSelector', function () {
'namespace': '=namespace',
'requireCreate': '=requireCreate'
},
controller: function($scope, $element, $cookieStore) {
controller: function($scope, $element, $routeParams, $cookieStore) {
$scope.namespaces = {};
$scope.initialize = function(user) {
@ -740,7 +740,7 @@ quayApp.directive('namespaceSelector', function () {
}
}
var initialNamespace = $cookieStore.get('quay.currentnamespace') || $scope.user.username;
var initialNamespace = $routeParams['namespace'] || $cookieStore.get('quay.currentnamespace') || $scope.user.username;
$scope.namespaces = namespaces;
$scope.setNamespace($scope.namespaces[initialNamespace]);
};