Commit 23106290 authored by Marc Duez's avatar Marc Duez

database.js : don't duplicate recently opened file

parent 8c81518c
......@@ -323,16 +323,23 @@ Database.prototype = {
for (var key in args) {
arg += "" + key + "=" + args[key] + "&";
}
var list = document.getElementById("last_loaded_file")
var children = list.children
var a = document.createElement('a');
a.className="buttonSelector"
a.appendChild(document.createTextNode(filename));
a.onclick = function () {
self.load_data(args, filename)
}
list.appendChild(a);
var flag = false
for (var i=0; i<children.length; i++){
if (children[i].innerHTML == filename) flag = true
}
if ( !flag){
var a = document.createElement('a');
a.className="buttonSelector"
a.appendChild(document.createTextNode(filename));
a.onclick = function () {
self.load_data(args, filename)
}
list.appendChild(a);
}
$.ajax({
type: "POST",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment