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

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

Issue 449843002: rebaseline-server: sorting of columns (asc/desc) in frontend. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rebased code Created 6 years, 4 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
« no previous file with comments | « gm/rebaseline_server/static/constants.js ('k') | gm/rebaseline_server/static/live-view.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/rebaseline_server/static/live-loader.js
diff --git a/gm/rebaseline_server/static/live-loader.js b/gm/rebaseline_server/static/live-loader.js
index 00800682f309c70c7df9cfcf4ab15be2d95d14e7..16a19aab788a6fdcbdab39c1f51bc6950b30841e 100644
--- a/gm/rebaseline_server/static/live-loader.js
+++ b/gm/rebaseline_server/static/live-loader.js
@@ -133,6 +133,9 @@ Loader.controller(
$scope.setBSection = $location.search().setBSection;
$scope.loadingMessage = "please wait...";
+ var currSortAsc = true;
+
+
/**
* On initial page load, load a full dictionary of results.
* Once the dictionary is loaded, unhide the page elements so they can
@@ -175,8 +178,11 @@ Loader.controller(
$scope.orderedColumnNames = data[constants.KEY__ROOT__EXTRACOLUMNORDER];
$scope.imagePairs = data[constants.KEY__ROOT__IMAGEPAIRS];
$scope.imageSets = data[constants.KEY__ROOT__IMAGESETS];
+
+ // set the default sort column and make it ascending.
$scope.sortColumnSubdict = constants.KEY__IMAGEPAIRS__DIFFERENCES;
$scope.sortColumnKey = constants.KEY__DIFFERENCES__PERCEPTUAL_DIFF;
+ currSortAsc = true;
$scope.showSubmitAdvancedSettings = false;
$scope.submitAdvancedSettings = {};
@@ -610,14 +616,7 @@ Loader.controller(
// array copies? (For better performance.)
if ($scope.viewingTab == $scope.defaultTab) {
-
- // TODO(epoger): Until we allow the user to reverse sort order,
- // there are certain columns we want to sort in a different order.
- var doReverse = (
- ($scope.sortColumnKey ==
- constants.KEY__DIFFERENCES__PERCENT_DIFF_PIXELS) ||
- ($scope.sortColumnKey ==
- constants.KEY__DIFFERENCES__PERCEPTUAL_DIFF));
+ var doReverse = !currSortAsc;
$scope.filteredImagePairs =
$filter("orderBy")(
« no previous file with comments | « gm/rebaseline_server/static/constants.js ('k') | gm/rebaseline_server/static/live-view.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698