From d0ab3f2bb0af9e440c5f8e66ce315779e4bb924c Mon Sep 17 00:00:00 2001 From: Ian Fitzpatrick Date: Thu, 1 Sep 2016 11:11:44 -0700 Subject: [PATCH] Add separate menu type for subgraphs --- the-graph-editor/the-graph-editor.html | 13 +++++++++++++ the-graph/the-graph-graph.js | 3 ++- the-graph/the-graph-node.js | 3 ++- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/the-graph-editor/the-graph-editor.html b/the-graph-editor/the-graph-editor.html index 4a196d62..0473fdd4 100644 --- a/the-graph-editor/the-graph-editor.html +++ b/the-graph-editor/the-graph-editor.html @@ -205,6 +205,19 @@ } }, e4: pasteMenu + }, + subgraph: { + actions: nodeActions, + s4: { + icon: "trash-o", + iconLabel: "delete", + action: nodeActions.delete + }, + w4: { + icon: "copy", + iconLabel: "copy", + action: nodeActions.copy + } } }; }, diff --git a/the-graph/the-graph-graph.js b/the-graph/the-graph-graph.js index 7c5e314a..4ea884ed 100644 --- a/the-graph/the-graph-graph.js +++ b/the-graph/the-graph-graph.js @@ -478,7 +478,8 @@ selected: selected, error: (self.state.errorNodes[key] === true), showContext: self.props.showContext, - highlightPort: highlightPort + highlightPort: highlightPort, + subgraph: componentInfo ? componentInfo.subgraph : false }; nodeOptions = TheGraph.merge(TheGraph.config.graph.node, nodeOptions); diff --git a/the-graph/the-graph-node.js b/the-graph/the-graph-node.js index 20e5dcec..e7621e63 100644 --- a/the-graph/the-graph-node.js +++ b/the-graph/the-graph-node.js @@ -226,7 +226,8 @@ // App.showContext this.props.showContext({ element: this, - type: (this.props.export ? (this.props.isIn ? "graphInport" : "graphOutport") : "node"), + type: (this.props.export ? (this.props.isIn ? "graphInport" : "graphOutport") : + this.props.subgraph ? "subgraph" : "node"), x: x, y: y, graph: this.props.graph,