Correcting avatars size when displaying edge infos and prevent to zoom on an edge when dragging

parent 86dc421d
......@@ -195,7 +195,7 @@
<div class="w3-cell-row">
<div class="w3-cell">
<div class="w3-container w3-center">
<img id="avatar_certifieur" class="w3-circle" src="" />
<img id="avatar_certifieur" width="100" class="w3-circle" src="" />
<h5 id="avatar_certifieur_name"></h5>
<small><a id="certifieur_link" href='#' target='_blank'>Profil Cesium</a></small>
......@@ -204,7 +204,7 @@
<div class="w3-cell w3-cell-middle"><i class="fa fa-angle-double-right fa-3x"></i><i class="fa fa-angle-double-right fa-3x"></i><i class="fa fa-angle-double-right fa-3x"></i></div>
<div class="w3-cell">
<div class="w3-container w3-center">
<img id="avatar_certifie" class="w3-circle" src="" />
<img id="avatar_certifie" width="100" class="w3-circle" src="" />
<h5 id="avatar_certifie_name"></h5>
<small><a id="certifie_link" href='#' target='_blank'>Profil Cesium</a></small>
</div>
......
......@@ -113,61 +113,63 @@ function displayGraph(s){
target = s.graph.nodes(edge.target)
nodesConcerned = [source.id,target.id];
if (selectedEdge === edge){
edgeAlreadySelected = "";
resetFilters();
centerCamera();
_.$("edgeInfos").style.display = 'none';
setTimeout(function(){displayEdges(true);}, 1500);
}else{
var edgeAlreadySelected = selectedEdge;
if (!edgeAlreadySelected){resetFilters();}
selectedEdge = edge;
_.$("nodeInfos").style.display = 'none';
_.$("start_cert").textContent = timestampToDate(edge.start_cert);
_.$("end_cert").textContent = timestampToDate(edge.end_cert);
_.$("avatar_certifieur_name").textContent = source.label;
_.$("certifieur_link").href = cesium + source.attributes.pubkey + '/' + source.label;
_.$("avatar_certifieur").style.cursor = "pointer";
_.$("avatar_certifieur").setAttribute("src", source.url);
_.$("avatar_certifieur").onclick = function(){history.pushState({ node: source }, source.attributes.pubkey, "./#");isolateNode(source);};
_.$("avatar_certifieur").setAttribute("title", source.attributes.pubkey);
_.$("avatar_certifie_name").textContent = target.label;
_.$("certifie_link").href = cesium + target.attributes.pubkey + '/' + target.label;
_.$("avatar_certifie").style.cursor = "pointer";
_.$("avatar_certifie").setAttribute("src", target.url);
_.$("avatar_certifie").onclick = function(){history.pushState({ node: target }, target.attributes.pubkey, "./#");isolateNode(target);};
_.$("avatar_certifie").setAttribute("title", target.attributes.pubkey);
if (!edgeAlreadySelected){
var centerx = Math.min(source[cam.readPrefix + 'x'],target[cam.readPrefix + 'x']) + Math.abs((source[cam.readPrefix + 'x']-target[cam.readPrefix + 'x'])/2);
var centery = Math.min(source[cam.readPrefix + 'y'],target[cam.readPrefix + 'y']) + Math.abs((source[cam.readPrefix + 'y']-target[cam.readPrefix + 'y'])/2);
if(!e.data.captor.isDragging){
if (selectedEdge === edge){
edgeAlreadySelected = "";
resetFilters();
centerCamera();
_.$("edgeInfos").style.display = 'none';
setTimeout(function(){displayEdges(true);}, 1500);
}else{
var edgeAlreadySelected = selectedEdge;
setTimeout(function(){loading(true);}, 25);
filter
.undo('filterEdge')
.nodesBy(function(n) {return isInArray(nodesConcerned, n.id);}, 'filterEdge')
.apply();
displayEdges(false);
setTimeout(function(){loading(true);}, 25);
sigma.misc.animation.camera(
cam,
{
x: centerx,
y: centery,
ratio: 0.5
},
{duration: 1500}
);
if (!edgeAlreadySelected){resetFilters();}
selectedEdge = edge;
_.$("nodeInfos").style.display = 'none';
_.$("start_cert").textContent = timestampToDate(edge.start_cert);
_.$("end_cert").textContent = timestampToDate(edge.end_cert);
_.$("avatar_certifieur_name").textContent = source.label;
_.$("certifieur_link").href = cesium + source.attributes.pubkey + '/' + source.label;
_.$("avatar_certifieur").style.cursor = "pointer";
_.$("avatar_certifieur").setAttribute("src", source.url);
_.$("avatar_certifieur").onclick = function(){history.pushState({ node: source }, source.attributes.pubkey, "./#");isolateNode(source);};
_.$("avatar_certifieur").setAttribute("title", source.attributes.pubkey);
_.$("avatar_certifie_name").textContent = target.label;
_.$("certifie_link").href = cesium + target.attributes.pubkey + '/' + target.label;
_.$("avatar_certifie").style.cursor = "pointer";
_.$("avatar_certifie").setAttribute("src", target.url);
_.$("avatar_certifie").onclick = function(){history.pushState({ node: target }, target.attributes.pubkey, "./#");isolateNode(target);};
_.$("avatar_certifie").setAttribute("title", target.attributes.pubkey);
if (!edgeAlreadySelected){
var centerx = Math.min(source[cam.readPrefix + 'x'],target[cam.readPrefix + 'x']) + Math.abs((source[cam.readPrefix + 'x']-target[cam.readPrefix + 'x'])/2);
var centery = Math.min(source[cam.readPrefix + 'y'],target[cam.readPrefix + 'y']) + Math.abs((source[cam.readPrefix + 'y']-target[cam.readPrefix + 'y'])/2);
setTimeout(function(){loading(true);}, 25);
filter
.undo('filterEdge')
.nodesBy(function(n) {return isInArray(nodesConcerned, n.id);}, 'filterEdge')
.apply();
displayEdges(false);
setTimeout(function(){loading(true);}, 25);
sigma.misc.animation.camera(
cam,
{
x: centerx,
y: centery,
ratio: 0.5
},
{duration: 1500}
);
}
_.$("edgeInfos").style.display = 'initial';
if (!edgeAlreadySelected){setTimeout(function(){displayEdges(true);}, 1500);}
}
_.$("edgeInfos").style.display = 'initial';
if (!edgeAlreadySelected){setTimeout(function(){displayEdges(true);}, 1500);}
}
}
......
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