From a03d926c7f6d03634d4c40b4f43fe12576cd45fe Mon Sep 17 00:00:00 2001 From: Alex de Mulder Date: Thu, 30 Apr 2015 17:04:08 +0200 Subject: [PATCH] fix manipulation bar hiding --- dist/vis.js | 12 ++++++++---- lib/network/modules/ManipulationSystem.js | 10 +++++++--- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/dist/vis.js b/dist/vis.js index eb067941..a93f5db8 100644 --- a/dist/vis.js +++ b/dist/vis.js @@ -24655,7 +24655,6 @@ return /******/ (function(modules) { // webpackBootstrap this.manipulationDiv.style.display = 'block'; this.closeDiv.style.display = 'block'; this.editModeDiv.style.display = 'none'; - this._bindHammerToDiv(this.closeDiv, this.toggleEditMode.bind(this)); this.showManipulatorToolbar(); } } @@ -24689,6 +24688,11 @@ return /******/ (function(modules) { // webpackBootstrap // if the gui is enabled, draw all elements. if (this.guiEnabled === true) { + // a _restore will hide these menus + this.editMode = true; + this.manipulationDiv.style.display = 'block'; + this.closeDiv.style.display = 'block'; + var selectedNodeCount = this.selectionHandler._getSelectedNodeCount(); var selectedEdgeCount = this.selectionHandler._getSelectedEdgeCount(); var selectedTotalCount = selectedNodeCount + selectedEdgeCount; @@ -25576,7 +25580,7 @@ return /******/ (function(modules) { // webpackBootstrap alert(this.options.locales[this.options.locale].createEdgeError); } else { if (this.body.nodes[connectFromId] !== undefined && this.body.nodes[node.id] !== undefined) { - this._performCreateEdge(connectFromId, node.id); + this._performAddEdge(connectFromId, node.id); } } } @@ -25621,14 +25625,14 @@ return /******/ (function(modules) { // webpackBootstrap } } }, { - key: '_performCreateEdge', + key: '_performAddEdge', /** * connect two nodes with a new edge. * * @private */ - value: function _performCreateEdge(sourceNodeId, targetNodeId) { + value: function _performAddEdge(sourceNodeId, targetNodeId) { var _this5 = this; var defaultData = { from: sourceNodeId, to: targetNodeId }; diff --git a/lib/network/modules/ManipulationSystem.js b/lib/network/modules/ManipulationSystem.js index c2f936f4..e1ef0461 100644 --- a/lib/network/modules/ManipulationSystem.js +++ b/lib/network/modules/ManipulationSystem.js @@ -116,7 +116,6 @@ class ManipulationSystem { this.manipulationDiv.style.display = 'block'; this.closeDiv.style.display = 'block'; this.editModeDiv.style.display = 'none'; - this._bindHammerToDiv(this.closeDiv, this.toggleEditMode.bind(this)); this.showManipulatorToolbar(); } } @@ -147,6 +146,11 @@ class ManipulationSystem { // if the gui is enabled, draw all elements. if (this.guiEnabled === true) { + // a _restore will hide these menus + this.editMode = true; + this.manipulationDiv.style.display = 'block'; + this.closeDiv.style.display = 'block'; + let selectedNodeCount = this.selectionHandler._getSelectedNodeCount(); let selectedEdgeCount = this.selectionHandler._getSelectedEdgeCount(); let selectedTotalCount = selectedNodeCount + selectedEdgeCount; @@ -1006,7 +1010,7 @@ class ManipulationSystem { } else { if (this.body.nodes[connectFromId] !== undefined && this.body.nodes[node.id] !== undefined) { - this._performCreateEdge(connectFromId, node.id); + this._performAddEdge(connectFromId, node.id); } } } @@ -1055,7 +1059,7 @@ class ManipulationSystem { * * @private */ - _performCreateEdge(sourceNodeId, targetNodeId) { + _performAddEdge(sourceNodeId, targetNodeId) { let defaultData = {from: sourceNodeId, to: targetNodeId}; if (typeof this.options.addEdge === 'function') { if (this.options.addEdge.length === 2) {