Skip to content

Commit

Permalink
Merge pull request #317 from marklogic-community/bugfix/316
Browse files Browse the repository at this point in the history
  • Loading branch information
josvanroosmalen authored Oct 13, 2020
2 parents fa45ae4 + b0e6898 commit f1eda85
Showing 1 changed file with 22 additions and 17 deletions.
39 changes: 22 additions & 17 deletions node_modules_override/litegraph.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
proxy: null, //used to redirect calls
node_images_path: "",

isConfiguring : false,
debug: false,
catch_exceptions: true,
throw_errors: true,
Expand Down Expand Up @@ -2008,7 +2009,7 @@
if (!data) {
return;
}

LiteGraph.isConfiguring = true;
if (!keep_old) {
this.clear();
}
Expand Down Expand Up @@ -2089,6 +2090,7 @@
this.updateExecutionOrder();
this._version++;
this.setDirtyCanvas(true, true);
LiteGraph.isConfiguring = false;
return error;
};

Expand Down Expand Up @@ -11110,20 +11112,23 @@ if (typeof exports != "undefined") {
);
this.subgraph.onOutputRemoved = this.onSubgraphRemovedOutput.bind(this);

let inBlock = LiteGraph.createNode("Graph/input");
inBlock.pos = [400, 400];
inBlock.ignore_remove = true
inBlock.properties.isMain = true
this.subgraph.add(inBlock);
inBlock.setProperty("name", "Item")

let outBlock = LiteGraph.createNode("Graph/output");
outBlock.pos = [1100, 400];
outBlock.ignore_remove = true
outBlock.properties.isMain = true
this.subgraph.add(outBlock);
outBlock.setProperty("name", "Result")

// in case we are loading data from JSON
// there is no need to do this. It will also interfere.
if (!LiteGraph.isConfiguring ) {
let inBlock = LiteGraph.createNode("Graph/input");
inBlock.pos = [400, 400];
inBlock.ignore_remove = true
inBlock.properties.isMain = true
this.subgraph.add(inBlock);
inBlock.setProperty("name", "Item")

let outBlock = LiteGraph.createNode("Graph/output");
outBlock.pos = [1100, 400];
outBlock.ignore_remove = true
outBlock.properties.isMain = true
this.subgraph.add(outBlock);
outBlock.setProperty("name", "Result")
}
}

Subgraph.title = "Subgraph";
Expand Down Expand Up @@ -11286,7 +11291,7 @@ if (typeof exports != "undefined") {
};

Subgraph.prototype.onSubgraphRemovedOutput = function (name) {
var slot = this.findInputSlot(name);
var slot = this.findOutputSlot(name);
if (slot == -1) {
return;
}
Expand Down Expand Up @@ -11592,7 +11597,7 @@ if (typeof exports != "undefined") {

GraphOutput.prototype.onRemoved = function () {
if (this.name_in_graph) {
this.graph.removeInput(this.name_in_graph);
this.graph.removeOutput(this.name_in_graph);
}
};

Expand Down

0 comments on commit f1eda85

Please sign in to comment.