Commit b88c8ff7 authored by Romain Loth's avatar Romain Loth

[FIX] project view: dont update when corpus is pending deletion + longer start interval

parent c65bd62d
...@@ -127,7 +127,14 @@ ...@@ -127,7 +127,14 @@
<ul> <ul>
<li <li
onclick=&quot; onclick=&quot;
garganrest.nodes.delete({{corpus.id}}, function(){$('#corpus_'+{{corpus.id}}).remove()}); trashedIds[{{corpus.id}}] = true ;
garganrest.nodes.delete(
{{corpus.id}},
function(){
$('#corpus_'+{{corpus.id}}).remove()
delete trashedIds[{{corpus.id}}]
}
);
$(this).parent().parent().remove(); $(this).parent().parent().remove();
&quot;> &quot;>
<a href='#'>Delete this</a> <a href='#'>Delete this</a>
...@@ -313,6 +320,9 @@ ...@@ -313,6 +320,9 @@
var corporaIds = [] var corporaIds = []
// for corpora ids whose delete is pending
var trashedIds = {}
for (var i = 0 ; i < corporaDivs.length ; i++) { for (var i = 0 ; i < corporaDivs.length ; i++) {
// ex: corpus_1198 // ex: corpus_1198
divId = corporaDivs[i].id divId = corporaDivs[i].id
...@@ -329,7 +339,6 @@ ...@@ -329,7 +339,6 @@
keepCheckingProjectStatus() keepCheckingProjectStatus()
} }
// cookie ajax helper ================================== // cookie ajax helper ==================================
function getCookie(name) { function getCookie(name) {
var cookieValue = null; var cookieValue = null;
...@@ -969,9 +978,8 @@ ...@@ -969,9 +978,8 @@
var activeCorporaIds = [] var activeCorporaIds = []
for (var i in corporaIds) { for (var i in corporaIds) {
var crid = corporaIds[i] var crid = corporaIds[i]
if (! document.getElementById( if ((! document.getElementById('corpus_'+crid+'_status_ok'))
'corpus_'+crid+'_status_ok') && (! trashedIds[crid])) {
) {
activeCorporaIds.push(crid) activeCorporaIds.push(crid)
} }
} }
...@@ -1002,7 +1010,7 @@ ...@@ -1002,7 +1010,7 @@
} }
else { else {
// decreasing intervals (preserving DB while "loosing interest") // decreasing intervals (preserving DB while "loosing interest")
nextTime = nChecks * 3000 nextTime = (nChecks+1) * 3000
// schedule next check // schedule next check
setTimeout(keepCheckingProjectStatus, nextTime) setTimeout(keepCheckingProjectStatus, nextTime)
console.log("next status check in", nextTime/1000, "s" ) console.log("next status check in", nextTime/1000, "s" )
......
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