diff --git a/packages/editor-ui/src/views/NodeView.vue b/packages/editor-ui/src/views/NodeView.vue index 288652dbe4..634096c8a4 100644 --- a/packages/editor-ui/src/views/NodeView.vue +++ b/packages/editor-ui/src/views/NodeView.vue @@ -188,6 +188,36 @@ const DEFAULT_START_NODE = { parameters: {}, }; +if (!window.localStorage.getItem('CURVINESS')) { + window.localStorage.setItem('CURVINESS', '150'); +} +// @ts-ignore +const _CURVINESS = parseInt(window.localStorage.getItem('CURVINESS'), 10); + +if (!window.localStorage.getItem('OUTLINE_STROKE_COLOR')) { + window.localStorage.setItem('OUTLINE_STROKE_COLOR', 'transparent'); +} +// @ts-ignore +const _OUTLINE_STROKE_COLOR = window.localStorage.getItem('OUTLINE_STROKE_COLOR'); + +if (!window.localStorage.getItem('OUTLINE_STROKE_WIDTH')) { + window.localStorage.setItem('OUTLINE_STROKE_WIDTH', '12'); +} +// @ts-ignore +const _OUTLINE_STROKE_WIDTH = parseInt(window.localStorage.getItem('OUTLINE_STROKE_WIDTH'), 10); + +if (!window.localStorage.getItem('ALWAYS_RESPECT_STUB')) { + window.localStorage.setItem('ALWAYS_RESPECT_STUB', 'false'); +} +// @ts-ignore +const _ALWAYS_RESPECT_STUB = window.localStorage.getItem('ALWAYS_RESPECT_STUB') === 'true'; + +if (!window.localStorage.getItem('PUSH_NODES_LENGTH')) { + window.localStorage.setItem('PUSH_NODES_LENGTH', 'false'); +} +// @ts-ignore +const _PUSH_NODES_LENGTH = parseInt(window.localStorage.getItem('PUSH_NODES_LENGTH'), 200); + export default mixins( copyPaste, externalHooks, @@ -1200,7 +1230,7 @@ export default mixins( const lastSelectedNode = this.lastSelectedNode; const lastSelectedNodeOutputIndex = this.$store.getters.lastSelectedNodeOutputIndex; if (lastSelectedNode) { - this.pushDownstreamNodes(200); + this.pushDownstreamNodes(_PUSH_NODES_LENGTH); // If a node is active then add the new node directly after the current one // newNodeData.position = [activeNode.position[0], activeNode.position[1] + 60]; newNodeData.position = getNewNodePosition( @@ -1295,30 +1325,6 @@ export default mixins( } }, initNodeView () { - if (!window.localStorage.getItem('CURVINESS')) { - window.localStorage.setItem('CURVINESS', '150'); - } - // @ts-ignore - const _CURVINESS = parseInt(window.localStorage.getItem('CURVINESS'), 10); - - if (!window.localStorage.getItem('OUTLINE_STROKE_COLOR')) { - window.localStorage.setItem('OUTLINE_STROKE_COLOR', 'transparent'); - } - // @ts-ignore - const _OUTLINE_STROKE_COLOR = window.localStorage.getItem('OUTLINE_STROKE_COLOR'); - - if (!window.localStorage.getItem('OUTLINE_STROKE_WIDTH')) { - window.localStorage.setItem('OUTLINE_STROKE_WIDTH', '12'); - } - // @ts-ignore - const _OUTLINE_STROKE_WIDTH = parseInt(window.localStorage.getItem('OUTLINE_STROKE_WIDTH'), 10); - - if (!window.localStorage.getItem('ALWAYS_RESPECT_STUB')) { - window.localStorage.setItem('ALWAYS_RESPECT_STUB', 'false'); - } - // @ts-ignore - const _ALWAYS_RESPECT_STUB = window.localStorage.getItem('ALWAYS_RESPECT_STUB') === 'true'; - this.instance.importDefaults({ Connector: ['Bezier', { curviness: _CURVINESS }], Endpoint: ['Dot', { radius: 5 }],