浏览代码

HUE-6143 [editor] Reset query history page to 1 when searching

Romain Rigaux 8 年之前
父节点
当前提交
ed85f60
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      desktop/libs/notebook/src/notebook/static/notebook/js/notebook.ko.js

+ 5 - 1
desktop/libs/notebook/src/notebook/static/notebook/js/notebook.ko.js

@@ -1755,7 +1755,11 @@ var EditorViewModel = (function() {
     self.historyFilterVisible = ko.observable(false);
     self.historyFilter.extend({ rateLimit: { method: "notifyWhenChangesStop", timeout: 900 } });
     self.historyFilter.subscribe(function(val){
-      self.fetchHistory();
+      if (self.historyCurrentPage() != 1) {
+        self.historyCurrentPage(1);
+      } else {
+        self.fetchHistory();
+      }
     });
     self.loadingHistory = ko.observable(self.history().length == 0);
     self.historyCurrentPage = ko.observable(vm.selectedNotebook() ? vm.selectedNotebook().historyCurrentPage() : 1);