From 8e840a8dd7ea35946ad6e61d27f58d37938a9f53 Mon Sep 17 00:00:00 2001 From: Martin Fischer Date: Thu, 6 Jan 2022 23:52:04 +0100 Subject: [PATCH] [fix 2/3] make search_on_category_select hide checkboxes Note that we inject the CSS via JavaScript instead of using css_dependencies because we do not wan the CSS to load when JavaScript is disabled (since in that case the checkboxes should be visible). --- searx/static/plugins/css/search_on_category_select.css | 1 + searx/static/plugins/js/search_on_category_select.js | 4 ++++ 2 files changed, 5 insertions(+) create mode 100644 searx/static/plugins/css/search_on_category_select.css diff --git a/searx/static/plugins/css/search_on_category_select.css b/searx/static/plugins/css/search_on_category_select.css new file mode 100644 index 000000000..3a25c66a0 --- /dev/null +++ b/searx/static/plugins/css/search_on_category_select.css @@ -0,0 +1 @@ +.category input { display: none; } diff --git a/searx/static/plugins/js/search_on_category_select.js b/searx/static/plugins/js/search_on_category_select.js index d590ed127..46d5335fd 100644 --- a/searx/static/plugins/js/search_on_category_select.js +++ b/searx/static/plugins/js/search_on_category_select.js @@ -40,3 +40,7 @@ function getHttpRequest() { } return httpRequest; } + +const style = document.createElement('style'); +style.textContent = '.category input { display: none; }' +document.head.append(style);