Commit d78f7c81 authored by Bryan  BRANCOTTE's avatar Bryan BRANCOTTE

Issue 161

parent 9cf0828e
......@@ -129,7 +129,7 @@ function host_changed_multiple(pks, checked, do_load_data){
}else{
for(var pk in pks){
//remove the column
$("[data-col="+pk+"]").remove();
$("[data-col="+pk+"]").popover('hide').popover('dispose').remove();
//mem["host"].remove(pk);
delete mem["host"][pk];
}
......@@ -171,7 +171,7 @@ function host_changed(pk, checked, do_load_data){
}
}else{
//remove the column
$("[data-col="+pk+"]").remove();
$("[data-col="+pk+"]").popover('hide').popover('dispose').remove();
//mem["host"].remove(pk);
delete mem["host"][pk];
if(do_load_data != false && $('select[name="host"]').parent().find('input[type="checkbox"]:checked').length==0){
......@@ -249,7 +249,7 @@ function virus_changed(pk, checked, do_load_data){
}
}else{
//remove the row
$("[data-row="+pk+"]").remove();
$("[data-row="+pk+"]").popover('hide').popover('dispose').remove();
delete mem["virus"][pk];
if(do_load_data != false && $('select[name="virus"]').parent().find('input[type="checkbox"]:checked').length==0){
load_data();
......@@ -515,16 +515,18 @@ function cell_popover(e){
popover.find("a.close_cmd").on('click', function(e){
elt.popover('hide').popover('dispose').attr("aria-describedby",null);
});
popover.find(".popover-header").on('click', function(e){
put_popover_in_front(popover);
});
popover.find(".popover-body").on('click', function(e){
put_popover_in_front(popover);
});
content = $('<dl class="mb-0">'+
'<dt>'+gettext("Virus")+'</dt>'+
'<dd data-row='+$(elt).attr("data-row")+'>'+
$('#grid_host th[data-row='+$(elt).attr('data-row')+']').html()+
'</dd>'+
'<dt>'+gettext("Host")+'</dt>'+
'<dd>'+
$('#grid_host th[data-col='+$(elt).attr('data-col')+']').html()+
'</dd></dl>'
content = $('<span>'+
'<b>'+gettext("Virus")+'</b><br/>'+
$('#grid_host th[data-row='+$(elt).attr('data-row')+']').html()+'<br/>'+
'<b>'+gettext("Host")+'</b><br/></span>'+
$('#grid_host th[data-col='+$(elt).attr('data-col')+']').html()+'<br/>'
).appendTo($(popover).find(".popover-body").empty());
let data="format=json";
......@@ -584,6 +586,13 @@ function cell_popover(e){
});
}
function put_popover_in_front(popover){
var elements = $(".popover");
var vals = [];
for(var i=0;typeof(elements[i])!='undefined';vals.push(parseInt($(elements[i++]).css('z-index'))));
popover.css("z-index", Math.max(...vals)+1);
}
function refresh_all_infection_ratio(){
$("#grid_host th .ratio").removeClass("computed");
refresh_infection_ratio();
......
......@@ -156,16 +156,21 @@ function hover_behavior(selector){
popover.find("a.close_cmd").on('click', function(e){
elt.popover('hide').popover('dispose').attr("aria-describedby",null);
});
popover.find(".popover-header").on('click', function(e){
put_popover_in_front(popover);
});
popover.find(".popover-body").on('click', function(e){
put_popover_in_front(popover);
});
var url=update_response.replace("000000",$(elt).attr("data-col")).replace("111111",$(elt).attr("data-row"));
content = $('<dl class="mb-0">'+
'<dt>'+gettext('Data source name')+'</dt>'+
'<dd data-data-source='+$(elt).attr("data-col")+'></dd>'+
'<dt>'+in_row_kind+'</dt>'+
'<dd data-row='+$(elt).attr("data-row")+'></dd>'+
'<dt>'+detailed_kind+'</dt>'+
'<dd>'+$("#detailed_name").html()+'</dd>'+
'</dl>'+
'<a class="allow-deco pull-right mb-2" href="'+url+'">'+gettext('See more details...')+'</a>'
content = $('<span>'+
'<b>'+gettext('Data source name')+'</b><br/>'+
'<span data-data-source='+$(elt).attr("data-col")+'></span><br/>'+
'<b>'+in_row_kind+'</b><br/>'+
'<span data-row='+$(elt).attr("data-row")+'></span><br/>'+
'<b>'+detailed_kind+'</b><br/>'+
'<span>'+$("#detailed_name").html()+'</span><br/></span>'+
'<div class="text-right"><a class="allow-deco" href="'+url+'">'+gettext('See more details...')+'</a></div>'
).appendTo($(popover).find(".popover-body").empty());
$($('#grid_host thead>tr>th[data-col='+$(elt).attr("data-col")+']').html()).appendTo(
content.find('[data-data-source='+$(elt).attr("data-col")+']')
......@@ -180,6 +185,13 @@ function hover_behavior(selector){
});
}
function put_popover_in_front(popover){
var elements = $(".popover");
var vals = [];
for(var i=0;typeof(elements[i])!='undefined';vals.push(parseInt($(elements[i++]).css('z-index'))));
popover.css("z-index", Math.max(...vals)+1);
}
function load_infection_ratios(){
let data_to_send=$('[name="weak_infection"]:checked').length?'weak_infection=on':'';
$.ajax({
......
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