From 4540a244f272fed5e8b842e47c7cbd934270b20b Mon Sep 17 00:00:00 2001 From: Janne Koschinski <janne@kuschku.de> Date: Fri, 16 Sep 2016 03:35:41 +0200 Subject: [PATCH] The search term now appears in the URL bar, and is reloaded on reload --- res/search.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/res/search.js b/res/search.js index 4cebbe4..8afc883 100644 --- a/res/search.js +++ b/res/search.js @@ -334,6 +334,7 @@ var search = function () { "query": $("#q").val(), "selected_history_entry": -1 }; + location.hash = state.query; load_search_overview(state.query, show_overview); add_to_history(state.query); update_history(); @@ -469,4 +470,8 @@ $("body").click(function (e) { $("nav").click(function (e) { e.stopPropagation(); -}); \ No newline at end of file +}); + +$("#q").val(location.hash.substr(1)); +if ($("#q").val()) + search(); \ No newline at end of file -- GitLab