From d0531c306453bc5be9b08b2d967bba43237bef7e Mon Sep 17 00:00:00 2001 From: Debanjum Singh Solanky Date: Sun, 28 Aug 2022 12:22:22 +0300 Subject: [PATCH] Update URL QueryParam when Type set in Dropdown on Web Interface - This also pushes the updated URL state to history - Allows jumping back to the web interface after clicking on an image and having the type set to image search - Previously type would get reset to the default search type on jumping back --- src/interface/web/index.html | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/interface/web/index.html b/src/interface/web/index.html index df4d3187..09f23e27 100644 --- a/src/interface/web/index.html +++ b/src/interface/web/index.html @@ -121,6 +121,12 @@ }); } + function setTypeInQueryParam(type) { + var url = new URL(window.location.href); + url.searchParams.set("t", type.value); + window.history.pushState({}, "", url.href); + } + window.onload = function () { // Dynamically populate type dropdown based on enabled search types and type passed as URL query parameter populate_type_dropdown(); @@ -140,7 +146,7 @@
- +