You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@climate.apache.org by jo...@apache.org on 2013/06/04 02:29:55 UTC

svn commit: r1489254 - in /incubator/climate/trunk/rcmet/src/main/ui/app: index.html js/controllers.js

Author: joyce
Date: Tue Jun  4 00:29:55 2013
New Revision: 1489254

URL: http://svn.apache.org/r1489254
Log:
Resolves CLIMATE-73 - Removes Update button.

Modified:
    incubator/climate/trunk/rcmet/src/main/ui/app/index.html
    incubator/climate/trunk/rcmet/src/main/ui/app/js/controllers.js

Modified: incubator/climate/trunk/rcmet/src/main/ui/app/index.html
URL: http://svn.apache.org/viewvc/incubator/climate/trunk/rcmet/src/main/ui/app/index.html?rev=1489254&r1=1489253&r2=1489254&view=diff
==============================================================================
--- incubator/climate/trunk/rcmet/src/main/ui/app/index.html (original)
+++ incubator/climate/trunk/rcmet/src/main/ui/app/index.html Tue Jun  4 00:29:55 2013
@@ -121,9 +121,6 @@
 		      <input ng-model="displayParams.lonMax" type="text" class="span2 text-center" />
         </form>
       </div>
-      <div class="span1">
-        <button ng-click="updateParameters()" ng-disabled="shouldDisableControls()" class="btn btn-block btn-info">Update</button>
-      </div>
       <div class="span2">
         <button ng-click="clearDatasets()" ng-disabled="shouldDisableClearButton()" class="btn btn-block btn-warning">Clear Datasets</button>
       </div>

Modified: incubator/climate/trunk/rcmet/src/main/ui/app/js/controllers.js
URL: http://svn.apache.org/viewvc/incubator/climate/trunk/rcmet/src/main/ui/app/js/controllers.js?rev=1489254&r1=1489253&r2=1489254&view=diff
==============================================================================
--- incubator/climate/trunk/rcmet/src/main/ui/app/js/controllers.js (original)
+++ incubator/climate/trunk/rcmet/src/main/ui/app/js/controllers.js Tue Jun  4 00:29:55 2013
@@ -88,14 +88,6 @@ function ParameterSelectCtrl($rootScope,
 	$scope.start = "1980-01-01 00:00:00";
 	$scope.end = "2030-01-01 00:00:00";
 
-	// The min/max lat/lon values entered by the user
-	$scope.enteredLatMin = "";
-	$scope.enteredLatMax = "";
-	$scope.enteredLonMin = "";
-	$scope.enteredLonMax = "";
-	$scope.enteredStart = "";
-	$scope.enteredEnd = "";
-
 	// The min/max lat/lon values that are displayed
 	$scope.displayParams = regionSelectParams.getParameters();
 
@@ -147,75 +139,6 @@ function ParameterSelectCtrl($rootScope,
 		changeYear: true,
 	};
 
-	var updateDisplayValues = function() {
-		// Update the displayed lat/lon values. We give precedence to users entered values assuming
-		// they're valid given the current set of datasets selected.
-		//
-		// If the user has entered a value for latMin
-		if ($scope.enteredLatMin != "") {
-			// If it's not a valid value...
-			if ($scope.enteredLatMin < $scope.latMin) {
-				// Reset enteredLatMin to the "unmodified" state and display the correct value.
-				$scope.displayParams.latMin = $scope.latMin;
-			} else {
-				$scope.displayParams.latMin = $scope.enteredLatMin;
-			}
-		// Otherwise, just display the value.
-		} else { 
-			$scope.displayParams.latMin = $scope.latMin;
-		}
-		// Update latMax
-		if ($scope.enteredLatMin != "") {
-			if ($scope.enteredLatMax > $scope.latMax) {
-				$scope.displayParams.latMax = $scope.latMax;
-			} else {
-				$scope.displayParams.latMax = $scope.enteredLatMax;
-			}
-		} else { 
-			$scope.displayParams.latMax = $scope.latMax;
-		}
-		// Update lonMin
-		if ($scope.enteredLonMin != "") {
-			if ($scope.enteredLonMin < $scope.lonMin) {
-				$scope.displayParams.lonMin = $scope.lonMin;
-			} else {
-				$scope.displayParams.lonMin = $scope.enteredLonMin;
-			}
-		} else { 
-			$scope.displayParams.lonMin = $scope.lonMin;
-		}
-		// Update lonMax
-		if ($scope.enteredLonMax != "") {
-			if ($scope.enteredLonMax > $scope.lonMax) {
-				$scope.displayParams.lonMax = $scope.lonMax;
-			} else {
-				$scope.displayParams.lonMax = $scope.enteredLonMax;
-			}
-		} else { 
-			$scope.displayParams.lonMax = $scope.lonMax;
-		}
-		// Update Start time
-		if ($scope.enteredStart != "") {
-			if ($scope.enteredStart < $scope.start) {
-				$scope.displayParams.start = $scope.start;
-			} else {
-				$scope.displayParams.start = $scope.enteredStart;
-			}
-		} else {
-			$scope.displayParams.start = $scope.start;
-		}
-		// Update End time
-		if ($scope.enteredEnd != "") {
-			if ($scope.enteredEnd > $scope.end) {
-				$scope.displayParams.end = $scope.end;
-			} else {
-				$scope.displayParams.end = $scope.enteredEnd;
-			}
-		} else {
-			$scope.displayParams.end = $scope.end;
-		}
-	}
-
 	$scope.shouldDisableControls = function() {
 		return (selectedDatasetInformation.getDatasetCount() < 2);
 	}
@@ -318,19 +241,6 @@ function ParameterSelectCtrl($rootScope,
 		});
 	}
 
-	$scope.updateParameters = function() {
-		// Save the user input, even if it isn't valid.
-		$scope.enteredLatMin = $scope.displayParams.latMin;
-		$scope.enteredLatMax = $scope.displayParams.latMax;
-		$scope.enteredLonMin = $scope.displayParams.lonMin;
-		$scope.enteredLonMax = $scope.displayParams.lonMax;
-		$scope.enteredStart  = $scope.displayParams.start;
-		$scope.enteredEnd    = $scope.displayParams.end;
-
-		// Check if the user values are valid and update the display values.
-		updateDisplayValues();
-	}
-
 	$scope.$watch('datasets', 
 		function() { 
 			var numDatasets = $scope.datasets.length;
@@ -362,14 +272,12 @@ function ParameterSelectCtrl($rootScope,
 				$scope.areInUserRegridState = !datasetRegrid
 			}
 
-			$scope.latMin = latMin;
-			$scope.latMax = latMax;
-			$scope.lonMin = lonMin;
-			$scope.lonMax = lonMax;
-			$scope.start = start.split(" ")[0];
-			$scope.end = end.split(" ")[0];
-
-			updateDisplayValues();
+			$scope.displayParams.latMin = latMin;
+			$scope.displayParams.latMax = latMax;
+			$scope.displayParams.lonMin = lonMin;
+			$scope.displayParams.lonMax = lonMax;
+			$scope.displayParams.start = start.split(" ")[0];
+			$scope.displayParams.end = end.split(" ")[0];
 		}, true);
 }