From d509008bc122260c5eb354cbd3a8a07ee2f65b96 Mon Sep 17 00:00:00 2001 From: Alex Yatskov Date: Fri, 27 Mar 2015 12:46:59 +0900 Subject: [PATCH] Sorting arrows --- static/index.html | 35 ++++++++++++++++++++++++++++------- static/scripts/search.js | 9 +++++++++ 2 files changed, 37 insertions(+), 7 deletions(-) diff --git a/static/index.html b/static/index.html index 47cebc6..7fefe2e 100644 --- a/static/index.html +++ b/static/index.html @@ -96,13 +96,34 @@ - - - - - - - + + + + + + + {{#each records}} diff --git a/static/scripts/search.js b/static/scripts/search.js index c4d46b9..e70e9f1 100644 --- a/static/scripts/search.js +++ b/static/scripts/search.js @@ -157,6 +157,15 @@ $('#records').empty(); $('#records').append(template({records: results.records})); + $('span.sort-icon').css('visibility', 'hidden'); + var currentColumn = $('span.sort-icon[data-sort="' + _ctx.sortKey + '"]').css('visibility', 'visible'); + if (_ctx.sortAsc) { + currentColumn.removeClass('glyphicon-chevron-down').addClass('glyphicon-chevron-up'); + } + else { + currentColumn.removeClass('glyphicon-chevron-up').addClass('glyphicon-chevron-down'); + } + if (results.records.length === 0) { $('#resultPanel').slideUp(); }
NameDistance to userClosest stationDistance to stationCompatibilityScoreAccess count + Name + + + Distance to user + + + Closest station + + + Distance to station + + + Compatibility + + + Score + + + Access count + +