diff --git a/ocw-ui/frontend/app/scripts/controllers/parameterselect.js b/ocw-ui/frontend/app/scripts/controllers/parameterselect.js index cad97e08..a2554f4c 100644 --- a/ocw-ui/frontend/app/scripts/controllers/parameterselect.js +++ b/ocw-ui/frontend/app/scripts/controllers/parameterselect.js @@ -27,9 +27,9 @@ * Controller of the ocwUiApp */ angular.module('ocwUiApp') -.controller('ParameterSelectCtrl', ['$rootScope', '$scope', '$http', '$timeout', - 'selectedDatasetInformation', 'regionSelectParams', 'evaluationSettings', - function($rootScope, $scope, $http, $timeout, selectedDatasetInformation, regionSelectParams, evaluationSettings) { +.controller('ParameterSelectCtrl', ['$rootScope', '$scope', '$http', '$timeout', '$location', + 'selectedDatasetInformation', 'regionSelectParams', 'evaluationSettings', + function($rootScope, $scope, $http, $timeout, $location, selectedDatasetInformation, regionSelectParams, evaluationSettings) { $scope.datasets = selectedDatasetInformation.getDatasets(); // The min/max lat/lon values from the selected datasets @@ -145,6 +145,8 @@ angular.module('ocwUiApp') data['temporal_resolution'] = 30; } + data['temporal_resolution_type'] = temporal_res; + // Load the Metrics for the evaluation data['metrics'] = [] var metrics = settings.metrics @@ -171,13 +173,9 @@ angular.module('ocwUiApp') $scope.runningEval = false; $timeout(function() { - if (evalWorkDir !== undefined) { - window.location = "#/results/" + evalWorkDir; - } else { - window.location = "#/results"; - } + var url = (evalWorkDir) ? '/results/' + evalWorkDir : '/results'; + $location.url(url) }, 100); - }).error(function() { $scope.runningEval = false; }); @@ -192,13 +190,13 @@ angular.module('ocwUiApp') if (parseFloat($scope.displayParams.latMax) > parseFloat($scope.latMax)) $scope.displayParams.latMax = $scope.latMax; - if (parseFloat($scope.displayParams.lonMin) < parseFloat($scope.lonMin)) + if (parseFloat($scope.displayParams.lonMin) < parseFloat($scope.lonMin)) $scope.displayParams.lonMin = $scope.lonMin; - if (parseFloat($scope.displayParams.lonMax) > parseFloat($scope.lonMax)) + if (parseFloat($scope.displayParams.lonMax) > parseFloat($scope.lonMax)) $scope.displayParams.lonMax = $scope.lonMax; - if ($scope.displayParams.start < $scope.start) + if ($scope.displayParams.start < $scope.start) $scope.displayParams.start = $scope.start; if ($scope.displayParams.end > $scope.end) @@ -213,8 +211,8 @@ angular.module('ocwUiApp') $rootScope.$broadcast('redrawOverlays', []); } - $scope.unwatchDatasets = $scope.$watch('datasets', - function() { + $scope.unwatchDatasets = $scope.$watch('datasets', + function() { var numDatasets = $scope.datasets.length; $scope.displayParams.areValid = false; $scope.areInUserRegridState = false; @@ -230,7 +228,7 @@ angular.module('ocwUiApp') // Get the valid lat/lon range in the selected datasets. for (var i = 0; i < numDatasets; i++) { var curDataset = $scope.datasets[i]; - + latMin = (curDataset['latlonVals']['latMin'] > latMin) ? curDataset['latlonVals']['latMin'] : latMin; latMax = (curDataset['latlonVals']['latMax'] < latMax) ? curDataset['latlonVals']['latMax'] : latMax; lonMin = (curDataset['latlonVals']['lonMin'] > lonMin) ? curDataset['latlonVals']['lonMin'] : lonMin;