Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Unified Diff: gm/rebaseline_server/static/loader.js

Issue 26659002: rebaseline_server: extend returned JSON dict to allow for result-editing in coming CL (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: gm/rebaseline_server/static/loader.js
===================================================================
--- gm/rebaseline_server/static/loader.js (revision 11659)
+++ gm/rebaseline_server/static/loader.js (working copy)
@@ -34,6 +34,7 @@
function($scope, $http, $filter) {
$http.get("/results/all").then(
function(response) {
+ $scope.header = response.data.header;
$scope.categories = response.data.categories;
$scope.testData = response.data.testData;
$scope.sortColumn = 'test';
@@ -41,11 +42,26 @@
$scope.hiddenResultTypes = [
'failure-ignored', 'no-comparison', 'succeeded'];
$scope.hiddenConfigs = [];
+ $scope.selectedItems = [];
jcgregorio 2013/10/09 14:41:48 Making this an {} would simplify the code since yo
epoger 2013/10/09 15:35:30 Great idea! Done.
$scope.updateResults();
}
);
+ $scope.isItemSelected = function(index) {
+ return ($scope.selectedItems.indexOf(index) >= 0);
jcgregorio 2013/10/09 14:41:48 If you don't switch to using a map, then this shou
epoger 2013/10/09 15:35:30 Switched to map.
+ }
+ $scope.toggleItemSelected = function(index) {
+ var i = $scope.selectedItems.indexOf(index);
+ if (i >= 0) {
+ $scope.selectedItems.splice(i, 1);
+ } else {
+ $scope.selectedItems.push(index);
+ }
+ // unlike other toggle methods below, does not set
+ // $scope.areUpdatesPending = true;
+ }
+
$scope.isHiddenResultType = function(thisResultType) {
return ($scope.hiddenResultTypes.indexOf(thisResultType) >= 0);
}

Powered by Google App Engine
This is Rietveld 408576698