Эх сурвалжийг харах

HUE-5180 [search] Use pushState to change URL when saving a new collection

Enrico Berti 9 жил өмнө
parent
commit
caa995fddf

+ 1 - 1
apps/search/src/search/static/search/js/search.ko.js

@@ -1804,7 +1804,7 @@ var SearchViewModel = function (collection_json, query_json, initial_json) {
         self.collection.id(data.id);
         $(document).trigger("info", data.message);
         if (window.location.search.indexOf("collection") == -1) {
-          window.location.hash = '#collection=' + data.id;
+          hueUtils.changeURL('/search/?collection=' + data.id);
         }
       }
       else {

+ 0 - 6
apps/search/src/search/templates/common_search.mako

@@ -25,12 +25,6 @@ from django.utils.translation import ugettext as _
 <%def name="page_structure(is_mobile=False)">
 
 <script type="text/javascript">
-  if (window.location.hash != "") {
-    if (window.location.hash.indexOf("collection") > -1) {
-      location.href = "/search/?" + window.location.hash.substr(1).replace(/(<([^>]+)>)/ig, "");
-    }
-  }
-
   SLIDER_LABELS = {
     STEP: "${_('Increment')}"
   }