Added deletion of joins
This commit is contained in:
parent
d0584e971d
commit
9c6ea37451
@ -30,6 +30,7 @@ function calculateOutputBlocks(){
|
||||
|
||||
events.subscribe("inputChanged", calculateOutputBlocks);
|
||||
events.subscribe("newJoin", calculateOutputBlocks);
|
||||
events.subscribe("joinRemove", calculateOutputBlocks);
|
||||
events.subscribe("diagramImport", calculateOutputBlocks);
|
||||
|
||||
window.calculate = calculateOutputBlocks;
|
||||
|
@ -56,6 +56,18 @@ $("#workspace").on("mouseup", ".block>.inputs>div", function(event){
|
||||
}
|
||||
});
|
||||
|
||||
$("#workspace").on("mousedown", ".block>.inputs>div", function(event){
|
||||
if(event.which == 3){ //right mouse button, delete
|
||||
event.preventDefault();
|
||||
var blockId = $(this).parent().parent().attr("id")
|
||||
var input = $(this).attr("id");
|
||||
var block = diagram.state.filter((block)=>(block.id == blockId))[0];
|
||||
delete block.inputs[input];
|
||||
drawJoiningLines();
|
||||
events.emit("joinRemove");
|
||||
}
|
||||
});
|
||||
|
||||
events.subscribe("blockMove", drawJoiningLines);
|
||||
events.subscribe("blockDelete", drawJoiningLines);
|
||||
events.subscribe("diagramImport", drawJoiningLines);
|
||||
|
Loading…
x
Reference in New Issue
Block a user