|
|
@ -841,6 +841,15 @@ Network.prototype._createKeyBinds = function() { |
|
|
|
|
|
|
|
|
|
|
|
Network.prototype.destroy = function() { |
|
|
|
this.start = function () {}; |
|
|
|
this.redraw = function () {}; |
|
|
|
this.timer = false; |
|
|
|
|
|
|
|
setTimeout(this._destroy.bind(this), 10); |
|
|
|
} |
|
|
|
|
|
|
|
Network.prototype._destroy = function() { |
|
|
|
|
|
|
|
// remove keybindings
|
|
|
|
this.keycharm.reset(); |
|
|
|
|
|
|
@ -850,7 +859,15 @@ Network.prototype.destroy = function() { |
|
|
|
// clear events
|
|
|
|
this.off(); |
|
|
|
|
|
|
|
// remove all elements from the container element.
|
|
|
|
while (this.frame.hasChildNodes()) { |
|
|
|
this.frame.removeChild(this.frame.firstChild); |
|
|
|
} |
|
|
|
|
|
|
|
// remove all elements from the container element.
|
|
|
|
while (this.containerElement.hasChildNodes()) { |
|
|
|
this.containerElement.removeChild(this.containerElement.firstChild); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -2520,7 +2537,10 @@ Network.prototype.animateView = function (options) { |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* used to animate smoothly by hijacking the redraw function. |
|
|
|
* @private |
|
|
|
*/ |
|
|
|
Network.prototype._lockedRedraw = function () { |
|
|
|
var nodePosition = {x: this.nodes[this.lockedOnNodeId].x, y: this.nodes[this.lockedOnNodeId].y}; |
|
|
|
var viewCenter = this.DOMtoCanvas({x: 0.5 * this.frame.canvas.clientWidth, y: 0.5 * this.frame.canvas.clientHeight}); |
|
|
|