From aaaed046378ad0c677927fca27aa36f249f80df6 Mon Sep 17 00:00:00 2001 From: maliming Date: Mon, 23 Mar 2020 11:35:32 +0800 Subject: [PATCH] Keep the hash of the url in the setQueryString method. Resolve #3234 --- .../Volo.Docs.Web/Pages/Documents/Project/index.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/index.js b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/index.js index 8f53f1cf6e..1b3d5ac7c3 100644 --- a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/index.js +++ b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/index.js @@ -119,16 +119,17 @@ }; var setQueryString = function () { - clearQueryString(); - - var uri = window.location.href.toString(); - var comboboxes = $(".doc-section-combobox"); - if (comboboxes.length < 1) { return; } + var hash = document.location.hash; + + clearQueryString(); + + var uri = window.location.href.toString(); + var new_uri = uri + "?"; for (var i = 0; i < comboboxes.length; i++) { @@ -142,7 +143,7 @@ } } - window.history.replaceState({}, document.title, new_uri); + window.history.replaceState({}, document.title, new_uri + hash); }; var getTenYearsLater = function () {