Browse Source

fix manipulation bar hiding

flowchartTest
Alex de Mulder 9 years ago
parent
commit
a03d926c7f
2 changed files with 15 additions and 7 deletions
  1. +8
    -4
      dist/vis.js
  2. +7
    -3
      lib/network/modules/ManipulationSystem.js

+ 8
- 4
dist/vis.js View File

@ -24655,7 +24655,6 @@ return /******/ (function(modules) { // webpackBootstrap
this.manipulationDiv.style.display = 'block'; this.manipulationDiv.style.display = 'block';
this.closeDiv.style.display = 'block'; this.closeDiv.style.display = 'block';
this.editModeDiv.style.display = 'none'; this.editModeDiv.style.display = 'none';
this._bindHammerToDiv(this.closeDiv, this.toggleEditMode.bind(this));
this.showManipulatorToolbar(); this.showManipulatorToolbar();
} }
} }
@ -24689,6 +24688,11 @@ return /******/ (function(modules) { // webpackBootstrap
// if the gui is enabled, draw all elements. // if the gui is enabled, draw all elements.
if (this.guiEnabled === true) { 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 selectedNodeCount = this.selectionHandler._getSelectedNodeCount();
var selectedEdgeCount = this.selectionHandler._getSelectedEdgeCount(); var selectedEdgeCount = this.selectionHandler._getSelectedEdgeCount();
var selectedTotalCount = selectedNodeCount + selectedEdgeCount; var selectedTotalCount = selectedNodeCount + selectedEdgeCount;
@ -25576,7 +25580,7 @@ return /******/ (function(modules) { // webpackBootstrap
alert(this.options.locales[this.options.locale].createEdgeError); alert(this.options.locales[this.options.locale].createEdgeError);
} else { } else {
if (this.body.nodes[connectFromId] !== undefined && this.body.nodes[node.id] !== undefined) { 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. * connect two nodes with a new edge.
* *
* @private * @private
*/ */
value: function _performCreateEdge(sourceNodeId, targetNodeId) {
value: function _performAddEdge(sourceNodeId, targetNodeId) {
var _this5 = this; var _this5 = this;
var defaultData = { from: sourceNodeId, to: targetNodeId }; var defaultData = { from: sourceNodeId, to: targetNodeId };

+ 7
- 3
lib/network/modules/ManipulationSystem.js View File

@ -116,7 +116,6 @@ class ManipulationSystem {
this.manipulationDiv.style.display = 'block'; this.manipulationDiv.style.display = 'block';
this.closeDiv.style.display = 'block'; this.closeDiv.style.display = 'block';
this.editModeDiv.style.display = 'none'; this.editModeDiv.style.display = 'none';
this._bindHammerToDiv(this.closeDiv, this.toggleEditMode.bind(this));
this.showManipulatorToolbar(); this.showManipulatorToolbar();
} }
} }
@ -147,6 +146,11 @@ class ManipulationSystem {
// if the gui is enabled, draw all elements. // if the gui is enabled, draw all elements.
if (this.guiEnabled === true) { 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 selectedNodeCount = this.selectionHandler._getSelectedNodeCount();
let selectedEdgeCount = this.selectionHandler._getSelectedEdgeCount(); let selectedEdgeCount = this.selectionHandler._getSelectedEdgeCount();
let selectedTotalCount = selectedNodeCount + selectedEdgeCount; let selectedTotalCount = selectedNodeCount + selectedEdgeCount;
@ -1006,7 +1010,7 @@ class ManipulationSystem {
} }
else { else {
if (this.body.nodes[connectFromId] !== undefined && this.body.nodes[node.id] !== undefined) { 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 * @private
*/ */
_performCreateEdge(sourceNodeId, targetNodeId) {
_performAddEdge(sourceNodeId, targetNodeId) {
let defaultData = {from: sourceNodeId, to: targetNodeId}; let defaultData = {from: sourceNodeId, to: targetNodeId};
if (typeof this.options.addEdge === 'function') { if (typeof this.options.addEdge === 'function') {
if (this.options.addEdge.length === 2) { if (this.options.addEdge.length === 2) {

Loading…
Cancel
Save