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 2014/02/28 06:49:07 UTC

svn commit: r1572832 - /incubator/climate/trunk/ocw-ui/frontend/app/js/controllers/ResultCtrl.js

Author: joyce
Date: Fri Feb 28 05:49:07 2014
New Revision: 1572832

URL: http://svn.apache.org/r1572832
Log:
CLIMATE-333 - Update backend call in ResultCtrl

CLIMATE-354 - Fix cache directory removal code

Modified:
    incubator/climate/trunk/ocw-ui/frontend/app/js/controllers/ResultCtrl.js

Modified: incubator/climate/trunk/ocw-ui/frontend/app/js/controllers/ResultCtrl.js
URL: http://svn.apache.org/viewvc/incubator/climate/trunk/ocw-ui/frontend/app/js/controllers/ResultCtrl.js?rev=1572832&r1=1572831&r2=1572832&view=diff
==============================================================================
--- incubator/climate/trunk/ocw-ui/frontend/app/js/controllers/ResultCtrl.js (original)
+++ incubator/climate/trunk/ocw-ui/frontend/app/js/controllers/ResultCtrl.js Fri Feb 28 05:49:07 2014
@@ -24,11 +24,15 @@ function($rootScope, $scope, $http) {
     $scope.results = [];
 
     // Get all evaluation directories
-    $http.jsonp($rootScope.baseURL + '/getResultDirInfo?callback=JSON_CALLBACK')
+    $http.jsonp($rootScope.baseURL + '/dir/results/?callback=JSON_CALLBACK')
     .success(function(data) {
-      var removeItem = "/cache";
-      data.splice( $.inArray(removeItem,data) ,1 );
-      $scope.results = data.sort().reverse();
-    });
+		data = data['listing']
+
+		var cacheDirIndex = data.indexOf("/cache");
+		if (cacheDirIndex > -1) {
+			data.split(cacheDirIndex, 1)
+		}
 
+		$scope.results = data.sort().reverse();
+    });
 }]);