fixed some refactor stuff in edit.ts
This commit is contained in:
parent
1d8bdfd728
commit
0555ad1020
2 changed files with 12 additions and 4 deletions
|
@ -565,7 +565,9 @@ function editNode(node) {
|
|||
function deleteNode(node) {
|
||||
_diagram.nodes["delete"](node.id);
|
||||
for (var i = 0; i < _diagram.connections.length; i++) {
|
||||
var _a = __read(_diagram.connections[i], 2), output = _a[0], input = _a[1];
|
||||
var connection = _diagram.connections[i];
|
||||
var output = connection.output;
|
||||
var input = connection.input;
|
||||
if (node.id == output.id || node.id == input.id) {
|
||||
_diagram.connections.splice(i, 1);
|
||||
i--;
|
||||
|
@ -626,7 +628,9 @@ function saveWatch() {
|
|||
var connections = new Array();
|
||||
try {
|
||||
for (var _e = __values(_diagram.connections), _f = _e.next(); !_f.done; _f = _e.next()) {
|
||||
var _g = __read(_f.value, 2), output = _g[0], input = _g[1];
|
||||
var connection = _f.value;
|
||||
var output = connection.output;
|
||||
var input = connection.input;
|
||||
connections.push({
|
||||
connection_watch_id: watchId,
|
||||
filter_output_id: output.id,
|
||||
|
|
|
@ -579,7 +579,9 @@ function editNode(node: DiagramNode){
|
|||
function deleteNode(node: DiagramNode){
|
||||
_diagram.nodes.delete(node.id)
|
||||
for (let i = 0; i < _diagram.connections.length; i++){
|
||||
let [output, input] = _diagram.connections[i];
|
||||
let connection = _diagram.connections[i];
|
||||
let output = connection.output;
|
||||
let input = connection.input;
|
||||
if (node.id == output.id || node.id == input.id){
|
||||
_diagram.connections.splice(i, 1)
|
||||
i--;
|
||||
|
@ -635,7 +637,9 @@ function saveWatch(){
|
|||
filtersInput.value = JSON.stringify(filters);
|
||||
|
||||
let connections = new Array<Object>();
|
||||
for (let [output, input] of _diagram.connections){
|
||||
for (let connection of _diagram.connections){
|
||||
let output = connection.output;
|
||||
let input = connection.input;
|
||||
connections.push({
|
||||
connection_watch_id: watchId,
|
||||
filter_output_id: output.id,
|
||||
|
|
Loading…
Add table
Reference in a new issue