Browse Source

fixed manipulation add edges view of edge that is created. Unfreeze after edge connected

v3_develop
Alex de Mulder 9 years ago
parent
commit
00121c8a79
2 changed files with 21 additions and 17 deletions
  1. +11
    -9
      dist/vis.js
  2. +10
    -8
      lib/network/mixins/ManipulationMixin.js

+ 11
- 9
dist/vis.js View File

@ -5,7 +5,7 @@
* A dynamic, browser-based visualization library. * A dynamic, browser-based visualization library.
* *
* @version 3.10.1-SNAPSHOT * @version 3.10.1-SNAPSHOT
* @date 2015-02-24
* @date 2015-02-26
* *
* @license * @license
* Copyright (C) 2011-2014 Almende B.V, http://almende.com * Copyright (C) 2011-2014 Almende B.V, http://almende.com
@ -33801,7 +33801,7 @@ return /******/ (function(modules) { // webpackBootstrap
delete this.sectors['support']['nodes']['targetNode']; delete this.sectors['support']['nodes']['targetNode'];
delete this.sectors['support']['nodes']['targetViaNode']; delete this.sectors['support']['nodes']['targetViaNode'];
this.controlNodesActive = false; this.controlNodesActive = false;
this.freezeSimulationEnabled = false;
this.freezeSimulation(false);
}; };
@ -33882,7 +33882,7 @@ return /******/ (function(modules) { // webpackBootstrap
this._restoreOverloadedFunctions(); this._restoreOverloadedFunctions();
// resume calculation // resume calculation
this.freezeSimulationEnabled = false;
this.freezeSimulation(false);
// reset global variables // reset global variables
this.blockConnectingEdgeSelection = false; this.blockConnectingEdgeSelection = false;
@ -34059,7 +34059,7 @@ return /******/ (function(modules) { // webpackBootstrap
// clear the toolbar // clear the toolbar
this._clearManipulatorBar(); this._clearManipulatorBar();
this._unselectAll(true); this._unselectAll(true);
this.freezeSimulationEnabled = true;
this.freezeSimulation(true);
if (this.boundFunction) { if (this.boundFunction) {
this.off('select', this.boundFunction); this.off('select', this.boundFunction);
@ -34190,7 +34190,7 @@ return /******/ (function(modules) { // webpackBootstrap
this.selectedControlNode = this.edgeBeingEdited._getSelectedControlNode(this._XconvertDOMtoCanvas(pointer.x),this._YconvertDOMtoCanvas(pointer.y)); this.selectedControlNode = this.edgeBeingEdited._getSelectedControlNode(this._XconvertDOMtoCanvas(pointer.x),this._YconvertDOMtoCanvas(pointer.y));
if (this.selectedControlNode !== null) { if (this.selectedControlNode !== null) {
this.selectedControlNode.select(); this.selectedControlNode.select();
this.freezeSimulationEnabled = true;
this.freezeSimulation(true);
} }
this._redraw(); this._redraw();
}; };
@ -34234,7 +34234,7 @@ return /******/ (function(modules) { // webpackBootstrap
else { else {
this.edgeBeingEdited._restoreControlNodes(); this.edgeBeingEdited._restoreControlNodes();
} }
this.freezeSimulationEnabled = false;
this.freezeSimulation(false);
this._redraw(); this._redraw();
}; };
@ -34276,11 +34276,13 @@ return /******/ (function(modules) { // webpackBootstrap
connectionEdge.to = targetNode; connectionEdge.to = targetNode;
this.cachedFunctions["_handleOnDrag"] = this._handleOnDrag; this.cachedFunctions["_handleOnDrag"] = this._handleOnDrag;
var me = this;
this._handleOnDrag = function(event) { this._handleOnDrag = function(event) {
var pointer = this._getPointer(event.gesture.center); var pointer = this._getPointer(event.gesture.center);
var connectionEdge = this.edges['connectionEdge'];
connectionEdge.to.x = this._XconvertDOMtoCanvas(pointer.x);
connectionEdge.to.y = this._YconvertDOMtoCanvas(pointer.y);
var connectionEdge = me.edges['connectionEdge'];
connectionEdge.to.x = me._XconvertDOMtoCanvas(pointer.x);
connectionEdge.to.y = me._YconvertDOMtoCanvas(pointer.y);
me._redraw();
}; };
this.moving = true; this.moving = true;

+ 10
- 8
lib/network/mixins/ManipulationMixin.js View File

@ -18,7 +18,7 @@ exports._clearManipulatorBar = function() {
delete this.sectors['support']['nodes']['targetNode']; delete this.sectors['support']['nodes']['targetNode'];
delete this.sectors['support']['nodes']['targetViaNode']; delete this.sectors['support']['nodes']['targetViaNode'];
this.controlNodesActive = false; this.controlNodesActive = false;
this.freezeSimulationEnabled = false;
this.freezeSimulation(false);
}; };
@ -99,7 +99,7 @@ exports._createManipulatorBar = function() {
this._restoreOverloadedFunctions(); this._restoreOverloadedFunctions();
// resume calculation // resume calculation
this.freezeSimulationEnabled = false;
this.freezeSimulation(false);
// reset global variables // reset global variables
this.blockConnectingEdgeSelection = false; this.blockConnectingEdgeSelection = false;
@ -276,7 +276,7 @@ exports._createAddEdgeToolbar = function() {
// clear the toolbar // clear the toolbar
this._clearManipulatorBar(); this._clearManipulatorBar();
this._unselectAll(true); this._unselectAll(true);
this.freezeSimulationEnabled = true;
this.freezeSimulation(true);
if (this.boundFunction) { if (this.boundFunction) {
this.off('select', this.boundFunction); this.off('select', this.boundFunction);
@ -407,7 +407,7 @@ exports._selectControlNode = function(pointer) {
this.selectedControlNode = this.edgeBeingEdited._getSelectedControlNode(this._XconvertDOMtoCanvas(pointer.x),this._YconvertDOMtoCanvas(pointer.y)); this.selectedControlNode = this.edgeBeingEdited._getSelectedControlNode(this._XconvertDOMtoCanvas(pointer.x),this._YconvertDOMtoCanvas(pointer.y));
if (this.selectedControlNode !== null) { if (this.selectedControlNode !== null) {
this.selectedControlNode.select(); this.selectedControlNode.select();
this.freezeSimulationEnabled = true;
this.freezeSimulation(true);
} }
this._redraw(); this._redraw();
}; };
@ -451,7 +451,7 @@ exports._releaseControlNode = function(pointer) {
else { else {
this.edgeBeingEdited._restoreControlNodes(); this.edgeBeingEdited._restoreControlNodes();
} }
this.freezeSimulationEnabled = false;
this.freezeSimulation(false);
this._redraw(); this._redraw();
}; };
@ -493,11 +493,13 @@ exports._handleConnect = function(pointer) {
connectionEdge.to = targetNode; connectionEdge.to = targetNode;
this.cachedFunctions["_handleOnDrag"] = this._handleOnDrag; this.cachedFunctions["_handleOnDrag"] = this._handleOnDrag;
var me = this;
this._handleOnDrag = function(event) { this._handleOnDrag = function(event) {
var pointer = this._getPointer(event.gesture.center); var pointer = this._getPointer(event.gesture.center);
var connectionEdge = this.edges['connectionEdge'];
connectionEdge.to.x = this._XconvertDOMtoCanvas(pointer.x);
connectionEdge.to.y = this._YconvertDOMtoCanvas(pointer.y);
var connectionEdge = me.edges['connectionEdge'];
connectionEdge.to.x = me._XconvertDOMtoCanvas(pointer.x);
connectionEdge.to.y = me._YconvertDOMtoCanvas(pointer.y);
me._redraw();
}; };
this.moving = true; this.moving = true;

Loading…
Cancel
Save