diff options
author | Serena Feng <feng.xiaowei@zte.com.cn> | 2018-03-09 06:49:25 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2018-03-09 06:49:25 +0000 |
commit | 7e2f383c4c36b4e55257a6c39da5b2ee92a3f5bd (patch) | |
tree | 6a2931f453f5918efaa8ebbfa5eeb1272cfd2e5f /testapi/opnfv_testapi/ui/components/deploy-results/deployResultsController.js | |
parent | 67f50b5771a27280d2a0038436dcea4011ff6345 (diff) | |
parent | bc5a216764b93ad9551830f2459194a4cea9d754 (diff) |
Merge "Keep state when user click back in browser"
Diffstat (limited to 'testapi/opnfv_testapi/ui/components/deploy-results/deployResultsController.js')
-rw-r--r-- | testapi/opnfv_testapi/ui/components/deploy-results/deployResultsController.js | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/testapi/opnfv_testapi/ui/components/deploy-results/deployResultsController.js b/testapi/opnfv_testapi/ui/components/deploy-results/deployResultsController.js index 5230a75..1128825 100644 --- a/testapi/opnfv_testapi/ui/components/deploy-results/deployResultsController.js +++ b/testapi/opnfv_testapi/ui/components/deploy-results/deployResultsController.js @@ -20,7 +20,8 @@ .controller('DeployResultsController', DeployResultsController); DeployResultsController.$inject = [ - '$scope', '$http', '$filter', '$state', 'testapiApiUrl','raiseAlert' + '$scope', '$http', '$filter', '$state', 'testapiApiUrl','raiseAlert', + 'keepState' ]; /** @@ -29,7 +30,7 @@ * a listing of community uploaded results. */ function DeployResultsController($scope, $http, $filter, $state, testapiApiUrl, - raiseAlert) { + raiseAlert, keepState) { var ctrl = this; ctrl.open = open; @@ -122,6 +123,15 @@ function filterList(){ if(ctrl.filter && ctrl.filterText!="" && ctrl.filterText!=undefined){ ctrl.tagArray[ctrl.filter] = ctrl.filterText; + if(!keepState.filter.deployResultFilter){ + keepState.filter.deployResultFilter = {} + } + keepState.filter.deployResultFilter[ctrl.filter] = ctrl.filterText + } + else if(Object.keys(ctrl.tagArray).length==0){ + if(keepState.filter.deployResultFilter){ + ctrl.tagArray = keepState.filter.deployResultFilter + } } ctrl.showError = false; var content_url = testapiApiUrl + '/deployresults' + |