Tracking: bump item to top of history when tracked another time (close #40)
This commit is contained in:
parent
9cc023dd96
commit
d2aab08a39
@ -94,7 +94,14 @@ function openTrackingHistory(code) {
|
||||
} else {
|
||||
history = JSON.parse(history);
|
||||
}
|
||||
if (infocontext.code != "" && !history.includes(infocontext.code)) {
|
||||
if (infocontext.code != "") {
|
||||
// Search the history list and remove the current code if it's there
|
||||
for (var i = 0; i < history.length; i++) {
|
||||
if (history[i] == infocontext.code) {
|
||||
history.splice(i, 1);
|
||||
}
|
||||
}
|
||||
// Add the code back to the list so it's at the top
|
||||
history.push(infocontext.code);
|
||||
}
|
||||
while (history.length > 5) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user