Skip to content
Snippets Groups Projects
Commit eb9cd77e authored by Janne Mareike Koschinski's avatar Janne Mareike Koschinski
Browse files

Fixed some minor history bugs

parent 218a8a35
Branches
No related tags found
No related merge requests found
......@@ -19,9 +19,9 @@ var search_history = {
var tmp = search_history.get().filter(function (x) {
return x != query;
});
}).reverse();
tmp.push(query);
localStorage.setItem('history', JSON.stringify(tmp.slice(0, tmp.max_size)));
localStorage.setItem('history', JSON.stringify(tmp.slice(Math.max(0, tmp.length - tmp.max_size))));
}
};
......@@ -360,8 +360,12 @@ var make_toggle_context = function (buffer, id) {
};
var hashChange = function () {
$("#q").val(decodeURIComponent(location.hash.substr(1)));
var input = $("#q");
var newquery = decodeURIComponent(location.hash.substr(1));
if (input.val() != newquery) {
input.val(newquery);
search();
}
};
var init = function () {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment