From 07470292057611e15188c15884d8425d307d186c Mon Sep 17 00:00:00 2001 From: Eric Cornelissen Date: Sat, 1 Sep 2018 12:20:04 +0300 Subject: [PATCH] Website/sort and search (#949) * Disable sort buttons when there is a search query * Restore sorting order when search query is removed * Update comment * Add button to sort by relevance (non-functional) As discussed in #949. Relatedly also removed the functionality that disabled the "sort by color" and "sort alphabetically" buttons (and related styling). * Update sorting behaviour Refactored to sorting algorithms into a single function and updated relevant code. The "sort by relenvance" button is now functional, and is automatically actived when the user starts searching, but not when updating their search query. * Restore sorting ordre when search query is removed * Only sort when needed * Refactor activing a sorting button/selecting a soring order * Renaming variables and functions * Add colors to "order by relevance" button on hover --- index.html | 1 + site_script.js | 84 +++++++++++++++++++++++++++++++++++--------------- stylesheet.css | 4 +++ 3 files changed, 64 insertions(+), 25 deletions(-) diff --git a/index.html b/index.html index 8e9b4c6a6..0099d3794 100644 --- a/index.html +++ b/index.html @@ -207,6 +207,7 @@ Sort by color Sort alphabetically + Sort by relevance