Fix history filter tags and search keyword might not apply after refresh

This commit is contained in:
Cheng-Han, Wu 2016-06-26 23:38:28 +08:00
parent 83d8142045
commit 357ad0b535

View file

@ -266,9 +266,23 @@ $(".ui-clear-history").click(function () {
}); });
$(".ui-refresh-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(); resetCheckAuth();
historyList.clear(); 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 () { $(".ui-logout").click(function () {