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) {
|
function deleteNode(node) {
|
||||||
_diagram.nodes["delete"](node.id);
|
_diagram.nodes["delete"](node.id);
|
||||||
for (var i = 0; i < _diagram.connections.length; i++) {
|
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) {
|
if (node.id == output.id || node.id == input.id) {
|
||||||
_diagram.connections.splice(i, 1);
|
_diagram.connections.splice(i, 1);
|
||||||
i--;
|
i--;
|
||||||
|
@ -626,7 +628,9 @@ function saveWatch() {
|
||||||
var connections = new Array();
|
var connections = new Array();
|
||||||
try {
|
try {
|
||||||
for (var _e = __values(_diagram.connections), _f = _e.next(); !_f.done; _f = _e.next()) {
|
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({
|
connections.push({
|
||||||
connection_watch_id: watchId,
|
connection_watch_id: watchId,
|
||||||
filter_output_id: output.id,
|
filter_output_id: output.id,
|
||||||
|
|
|
@ -579,7 +579,9 @@ function editNode(node: DiagramNode){
|
||||||
function deleteNode(node: DiagramNode){
|
function deleteNode(node: DiagramNode){
|
||||||
_diagram.nodes.delete(node.id)
|
_diagram.nodes.delete(node.id)
|
||||||
for (let i = 0; i < _diagram.connections.length; i++){
|
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){
|
if (node.id == output.id || node.id == input.id){
|
||||||
_diagram.connections.splice(i, 1)
|
_diagram.connections.splice(i, 1)
|
||||||
i--;
|
i--;
|
||||||
|
@ -635,7 +637,9 @@ function saveWatch(){
|
||||||
filtersInput.value = JSON.stringify(filters);
|
filtersInput.value = JSON.stringify(filters);
|
||||||
|
|
||||||
let connections = new Array<Object>();
|
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({
|
connections.push({
|
||||||
connection_watch_id: watchId,
|
connection_watch_id: watchId,
|
||||||
filter_output_id: output.id,
|
filter_output_id: output.id,
|
||||||
|
|
Loading…
Add table
Reference in a new issue