Commit 23106290 authored by Marc Duez's avatar Marc Duez
Browse files

database.js : don't duplicate recently opened file

parent 8c81518c
...@@ -323,9 +323,15 @@ Database.prototype = { ...@@ -323,9 +323,15 @@ Database.prototype = {
for (var key in args) { for (var key in args) {
arg += "" + key + "=" + args[key] + "&"; arg += "" + key + "=" + args[key] + "&";
} }
var list = document.getElementById("last_loaded_file") var list = document.getElementById("last_loaded_file")
var children = list.children
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'); var a = document.createElement('a');
a.className="buttonSelector" a.className="buttonSelector"
a.appendChild(document.createTextNode(filename)); a.appendChild(document.createTextNode(filename));
...@@ -333,6 +339,7 @@ Database.prototype = { ...@@ -333,6 +339,7 @@ Database.prototype = {
self.load_data(args, filename) self.load_data(args, filename)
} }
list.appendChild(a); list.appendChild(a);
}
$.ajax({ $.ajax({
type: "POST", 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