diff --git a/awx/ui/client/src/portal-mode/portal-mode-jobs.controller.js b/awx/ui/client/src/portal-mode/portal-mode-jobs.controller.js index ce890153a7..34669c74e9 100644 --- a/awx/ui/client/src/portal-mode/portal-mode-jobs.controller.js +++ b/awx/ui/client/src/portal-mode/portal-mode-jobs.controller.js @@ -23,7 +23,7 @@ export function PortalModeJobsController($scope, $rootScope, GetBasePath, Genera $scope.iterator = list.iterator; $scope.activeFilter = 'user'; - var init = function(){ + var init = function(sort){ view.inject(list, { id: 'portal-jobs', mode: 'edit', @@ -45,8 +45,10 @@ export function PortalModeJobsController($scope, $rootScope, GetBasePath, Genera pageSize: pageSize }); $scope.search (list.iterator); - // hack to default to descending sort order - $scope.sort('job','finished'); + if(sort) { + // hack to default to descending sort order + $scope.sort('job','finished'); + } }; @@ -67,7 +69,7 @@ export function PortalModeJobsController($scope, $rootScope, GetBasePath, Genera $scope.search(list.iterator); }; - init(); + init(true); } PortalModeJobsController.$inject = ['$scope', '$rootScope', 'GetBasePath', 'generateList', 'PortalJobsList', 'SearchInit',