From acf0ae0fad2b49edd612295d34aabe473d2bb5c9 Mon Sep 17 00:00:00 2001 From: kilo Date: Mon, 10 Jul 2017 07:36:24 +0200 Subject: [PATCH] Make refine button submit form if refine dropdown doesn't exist (#1149) * Update site.jet.html * Update main.js * remove onload * Update main.js --- public/js/main.js | 6 ++++-- templates/layouts/partials/helpers/search.jet.html | 2 +- templates/layouts/partials/menu/site.jet.html | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/public/js/main.js b/public/js/main.js index 92f9acdf..6794a159 100644 --- a/public/js/main.js +++ b/public/js/main.js @@ -87,7 +87,9 @@ function playVoice() { } function toggleRefine() { - document.getElementsByClassName("box refine")[0].style.display = document.getElementsByClassName("box refine")[0].style.display == "none" ? "block" : "none"; - return 0; + var refine_form = document.getElementsByClassName("box refine")[0]; + refine_form.type = "button"; + if(refine_form != "undefined") refine.style.display = refine.style.display == "none" ? "block" : "none"; + else document.getElementById("header-form").submit(); } // @license-end diff --git a/templates/layouts/partials/helpers/search.jet.html b/templates/layouts/partials/helpers/search.jet.html index 3d78269c..fc2b9b3e 100644 --- a/templates/layouts/partials/helpers/search.jet.html +++ b/templates/layouts/partials/helpers/search.jet.html @@ -10,7 +10,7 @@ {{block search_button() }} - + {{end}} {{block search_refine() }}

{{ T("refine_search") }}

diff --git a/templates/layouts/partials/menu/site.jet.html b/templates/layouts/partials/menu/site.jet.html index 682d9fd9..cbdbcc68 100644 --- a/templates/layouts/partials/menu/site.jet.html +++ b/templates/layouts/partials/menu/site.jet.html @@ -19,10 +19,10 @@
{{ include "layouts/partials/helpers/badgemenu" }}
- \ No newline at end of file +