From b4c9d7cd1bc9adae40fccb0120c736eeab9caab3 Mon Sep 17 00:00:00 2001 From: Nicolas F Date: Sat, 21 Oct 2017 06:01:36 +0200 Subject: [PATCH] Fix filter dropdowns if JS is disabled (#389) Before bootstrap-select is loaded, a small JS piece replaces the class for the pickers with the appropriate bootstrap-select classes. If there is no JS, the dropdowns will stay as form-control. --- nyaa/static/js/compat.js | 5 +++++ nyaa/templates/layout.html | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 nyaa/static/js/compat.js diff --git a/nyaa/static/js/compat.js b/nyaa/static/js/compat.js new file mode 100644 index 0000000..22f2516 --- /dev/null +++ b/nyaa/static/js/compat.js @@ -0,0 +1,5 @@ +// Filter dropdown styling if JS is enabled +$(function() { + $("#navFilter-category, #navFilter-criteria").children("select").removeClass("form-control").addClass("selectpicker show-tick"); + } +); diff --git a/nyaa/templates/layout.html b/nyaa/templates/layout.html index a37009e..01afd67 100644 --- a/nyaa/templates/layout.html +++ b/nyaa/templates/layout.html @@ -42,6 +42,7 @@ + @@ -263,7 +264,7 @@ {% endif %}