Browse Source

- Improved cleaning up of the physics configuration on destroy and in options.

v3_develop
Alex de Mulder 9 years ago
parent
commit
8e80076825
5 changed files with 2406 additions and 2367 deletions
  1. +1
    -0
      HISTORY.md
  2. +2386
    -2367
      dist/vis.js
  3. +3
    -0
      lib/network/Network.js
  4. +3
    -0
      lib/network/mixins/MixinLoader.js
  5. +13
    -0
      lib/network/mixins/physics/PhysicsMixin.js

+ 1
- 0
HISTORY.md View File

@ -13,6 +13,7 @@ http://visjs.org
- Made physics more stable (albeit a little slower).
- Added a check so only one 'activator' overlay is created on clickToUse.
- Made global color options for edges overrule the inheritColors.
- Improved cleaning up of the physics configuration on destroy and in options.
### Graph2d

+ 2386
- 2367
dist/vis.js
File diff suppressed because it is too large
View File


+ 3
- 0
lib/network/Network.js View File

@ -852,6 +852,9 @@ Network.prototype.destroy = function() {
this.redraw = function () {};
this.timer = false;
// cleanup physicsConfiguration if it exists
this._cleanupPhysicsConfiguration();
// remove keybindings
this.keycharm.reset();

+ 3
- 0
lib/network/mixins/MixinLoader.js View File

@ -47,6 +47,9 @@ exports._loadPhysicsSystem = function () {
if (this.constants.configurePhysics == true) {
this._loadPhysicsConfiguration();
}
else {
this._cleanupPhysicsConfiguration();
}
};

+ 13
- 0
lib/network/mixins/physics/PhysicsMixin.js View File

@ -305,6 +305,17 @@ exports._calculateSpringForce = function (node1, node2, edgeLength) {
};
exports._cleanupPhysicsConfiguration = function() {
if (this.physicsConfiguration !== undefined) {
while (this.physicsConfiguration.hasChildNodes()) {
this.physicsConfiguration.removeChild(this.physicsConfiguration.firstChild);
}
this.physicsConfiguration.parentNode.removeChild(this.physicsConfiguration);
this.physicsConfiguration = undefined;
}
}
/**
* Load the HTML for the physics config and bind it
* @private
@ -706,3 +717,5 @@ function showValueOfRange (id,map,constantsVariableName) {
this.moving = true;
this.start();
}

Loading…
Cancel
Save