diff options
author | Cheng-Han, Wu | 2016-06-26 23:38:28 +0800 |
---|---|---|
committer | Cheng-Han, Wu | 2016-06-26 23:38:28 +0800 |
commit | 357ad0b535301f93a4a69690969b07a8bd409423 (patch) | |
tree | 604358124628d8166603bb21087d51e952574506 | |
parent | 83d81420452b2bf92fac014a8fdb681385bc8e47 (diff) |
Fix history filter tags and search keyword might not apply after refresh
-rw-r--r-- | public/js/cover.js | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/public/js/cover.js b/public/js/cover.js index 77444542..6f46ab88 100644 --- a/public/js/cover.js +++ b/public/js/cover.js @@ -266,9 +266,23 @@ $(".ui-clear-history").click(function () { }); $(".ui-refresh-history").click(function () { + var lastTags = $(".ui-use-tags").select2('val'); + $(".ui-use-tags").select2('val', ''); + historyList.filter(); + var lastKeyword = $('.search').val(); + $('.search').val(''); + historyList.search(); + resetCheckAuth(); historyList.clear(); - parseHistory(historyList, parseHistoryCallback); + parseHistory(historyList, function (list, notehistory) { + parseHistoryCallback(list, notehistory); + $(".ui-use-tags").select2('val', lastTags); + $(".ui-use-tags").trigger('change'); + historyList.search(lastKeyword); + $('.search').val(lastKeyword); + checkHistoryList(); + }); }); $(".ui-logout").click(function () { |