Skip to content

Commit 357ad0b

Browse files
committed
Fix history filter tags and search keyword might not apply after refresh
1 parent 83d8142 commit 357ad0b

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

public/js/cover.js

+15-1
Original file line numberDiff line numberDiff line change
@@ -266,9 +266,23 @@ $(".ui-clear-history").click(function () {
266266
});
267267

268268
$(".ui-refresh-history").click(function () {
269+
var lastTags = $(".ui-use-tags").select2('val');
270+
$(".ui-use-tags").select2('val', '');
271+
historyList.filter();
272+
var lastKeyword = $('.search').val();
273+
$('.search').val('');
274+
historyList.search();
275+
269276
resetCheckAuth();
270277
historyList.clear();
271-
parseHistory(historyList, parseHistoryCallback);
278+
parseHistory(historyList, function (list, notehistory) {
279+
parseHistoryCallback(list, notehistory);
280+
$(".ui-use-tags").select2('val', lastTags);
281+
$(".ui-use-tags").trigger('change');
282+
historyList.search(lastKeyword);
283+
$('.search').val(lastKeyword);
284+
checkHistoryList();
285+
});
272286
});
273287

274288
$(".ui-logout").click(function () {

0 commit comments

Comments
 (0)