فهرست منبع

HUE-7545 [search] Reset query string in URL when it becomes empty

Romain Rigaux 8 سال پیش
والد
کامیت
2db2368
1فایلهای تغییر یافته به همراه2 افزوده شده و 2 حذف شده
  1. 2 2
      desktop/libs/dashboard/src/dashboard/static/dashboard/js/search.ko.js

+ 2 - 2
desktop/libs/dashboard/src/dashboard/static/dashboard/js/search.ko.js

@@ -2010,8 +2010,8 @@ var SearchViewModel = function (collection_json, query_json, initial_json) {
       }
       else if (location.getParameter("collection") != "") {
         var firstQuery = self.query.qs()[0].q();
-        if (firstQuery) {
-          hueUtils.changeURL("?collection=" + location.getParameter("collection") + "&q=" + firstQuery);
+        if (firstQuery != location.getParameter("q")) {
+          hueUtils.changeURL("?collection=" + location.getParameter("collection") + (firstQuery ? "&q=" + firstQuery : ""));
         }
       }