Commit a2afd5b7 authored by Sebastien Robin's avatar Sebastien Robin

gui prototype: allow to delete connections

parent 906063be
...@@ -30,28 +30,21 @@ ...@@ -30,28 +30,21 @@
gradient:{stops:[[0, color], [0.5, gradient_color], [1, color]]}, gradient:{stops:[[0, color], [0.5, gradient_color], [1, color]]},
lineWidth:5, lineWidth:5,
strokeStyle:color, strokeStyle:color,
dashstyle:"2 2"
}, },
Anchor: "Continuous", Anchor: "Continuous",
Connector: ["StateMachine", { curviness:20 }], Connector: ["StateMachine", { curviness:20 }],
}); });
var init = function(connection) {
connection.bind("editCompleted", function(o) {
});
};
// listen for new connections; initialise them the same way we initialise the connections at startup.
jsPlumb.bind("jsPlumbConnection", function(connInfo, originalEvent) {
init(connInfo.connection);
});
// listen for clicks on connections, and offer to change values on click. // listen for clicks on connections, and offer to change values on click.
jsPlumb.bind("click", function(conn, originalEvent) { jsPlumb.bind("click", function(conn) {
console.log("user click connection", conn); console.log("user click connection", conn);
priv.dialog_connection = conn; //priv.dialog_connection = conn;
$( "#dialog-form" ).dialog( "open" ); jsPlumb.detach(conn);
}); });
jsPlumb.bind("beforeDetach", function(conn) {
return confirm("Delete connection?");
});
jsPlumb.bind("connectionDrag", function(connection) { jsPlumb.bind("connectionDrag", function(connection) {
console.log("connection " + connection.id + " is being dragged"); console.log("connection " + connection.id + " is being dragged");
......
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