Commit 3cacd951 authored by AudreyGl's avatar AudreyGl

Fix bug colonnes

parent 8199818c
......@@ -163,35 +163,40 @@ $("#addNode").click(function() {
auteur: $("#auteur").val()
};
$.ajax({
type: 'POST',
data: newContrib,
url: '/contributions/',
dataType: 'text',
}).done(function(response) {
//if(selected != null){
$.ajax({
type: 'POST',
data: newContrib,
url: '/contributions/',
dataType: 'text',
}).done(function(response) {
var newNodeObj = {
type: $("#type").val(),
name: $("#label").val(),
attributes: [],
children: [],
value: $("#comment").val()
};
var newNode = d3.hierarchy(newNodeObj);
newNode.depth = selected.depth + 1;
newNode.height = selected.height - 1;
newNode.parent = selected;
newNode.id =$("#label").val(); // label
if(!selected.children){
selected.children = [];
selected.data.children = [];
}
selected.children.push(newNode);
update(selected);
var newNodeObj = {
type: $("#type").val(),
name: $("#label").val(),
attributes: [],
children: [],
value: $("#comment").val()
};
var newNode = d3.hierarchy(newNodeObj);
newNode.depth = selected.depth + 1;
newNode.height = selected.height - 1;
newNode.parent = selected;
newNode.id =$("#label").val(); // label
if(!selected.children){
selected.children = [];
selected.data.children = [];
}
selected.children.push(newNode);
update(selected);
});
});
//}
selected = null;
});
......@@ -321,6 +326,8 @@ function handleMouseOver(d) {
.style("top", (d3.event.pageY - 28) + "px");
}
div.style("display","inline-block");
......
......@@ -75,6 +75,7 @@
</tbody>
</table> -->
</div>
</div>
<div id="affTreeMap" class="container col-md-8">
<svg width="672" height="672"></svg>
......
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