mirror of https://github.com/MISP/misp-dashboard
ui fix: prevent race condition with popover trophy update
parent
49c21b14a1
commit
a4655fce49
|
@ -527,8 +527,14 @@ function updateProgressHeader(org) {
|
||||||
categ = trophy_categ_list[i];
|
categ = trophy_categ_list[i];
|
||||||
$('#trophy_'+categ).attr('src', source);
|
$('#trophy_'+categ).attr('src', source);
|
||||||
$('#trophy_'+categ).attr('title', "");
|
$('#trophy_'+categ).attr('title', "");
|
||||||
$('#trophy_'+categ).popover("destroy")
|
try { // in case popover not created
|
||||||
|
var pop = $('#trophy_'+categ).data('bs.popover');
|
||||||
|
pop.destroy();
|
||||||
|
} catch(err) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
setTimeout(function() { // avoid race condition with destroy
|
||||||
for(var i=0; i<data.length; i++) { // add
|
for(var i=0; i<data.length; i++) { // add
|
||||||
categ = data[i].categ;
|
categ = data[i].categ;
|
||||||
rank = data[i].trophy_true_rank;
|
rank = data[i].trophy_true_rank;
|
||||||
|
@ -538,6 +544,7 @@ function updateProgressHeader(org) {
|
||||||
$('#trophy_'+categ).attr('title', trophy_title[rank]);
|
$('#trophy_'+categ).attr('title', trophy_title[rank]);
|
||||||
$('#trophy_'+categ).popover({title: trophy_title[rank], content: 'Level: '+rank+' ('+trophy_points+' points)', trigger: "hover", placement: "bottom"});
|
$('#trophy_'+categ).popover({title: trophy_title[rank], content: 'Level: '+rank+' ('+trophy_points+' points)', trigger: "hover", placement: "bottom"});
|
||||||
}
|
}
|
||||||
|
}, 300);
|
||||||
});
|
});
|
||||||
|
|
||||||
//update overtake points
|
//update overtake points
|
||||||
|
|
Loading…
Reference in New Issue