From f3b8c4875d9d42a00bea07291bc140a678938b27 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Fri, 23 Aug 2019 13:26:20 -0700 Subject: [PATCH] When selecting orderby=random, hide the asc/desc dropdown. --- frontends/etiquette_flask/templates/search.html | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/frontends/etiquette_flask/templates/search.html b/frontends/etiquette_flask/templates/search.html index dda78b0..dc16ab2 100644 --- a/frontends/etiquette_flask/templates/search.html +++ b/frontends/etiquette_flask/templates/search.html @@ -147,7 +147,7 @@ {% macro create_orderby_li(selected_column, selected_sorter) %}
  • - @@ -158,7 +158,7 @@ - @@ -458,6 +458,17 @@ function orderby_remove_hook(button) ul.removeChild(li); } } +function orderby_hide_direction_hook(event) +{ + if (event.target.value == "random") + { + event.target.nextElementSibling.classList.add("hidden"); + } + else + { + event.target.nextElementSibling.classList.remove("hidden"); + } +} function simplify_tagnames(tags) { var new_tags = [];