Browse Source

added destroy method

v3_develop
Alex de Mulder 9 years ago
parent
commit
c5be64e558
4 changed files with 2036 additions and 2002 deletions
  1. +1
    -1
      HISTORY.md
  2. +2015
    -2000
      dist/vis.js
  3. +5
    -1
      docs/network.html
  4. +15
    -0
      lib/network/Network.js

+ 1
- 1
HISTORY.md View File

@ -35,7 +35,7 @@ http://visjs.org
strange behaviour in manipulation mode
- Better cleanup after reconnecting edges in manipulation mode
- Fixed recursion error with smooth edges that are connected to non-existent nodes
- Added destroy method.
## 2014-11-28, version 3.7.1

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


+ 5
- 1
docs/network.html View File

@ -2222,7 +2222,11 @@ var options = {
<td>none</td>
<td>Remove an event listener created before via function <code>on(event, callback)</code>. See section <a href="#Events">Events</a> for more information.</td>
</tr>
<tr>
<td>destroy()</td>
<td>none</td>
<td>Remove all bindings and clean up after the Network.</td>
</tr>
<tr>
<td>redraw()</td>
<td>none</td>

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

@ -835,6 +835,21 @@ Network.prototype._createKeyBinds = function() {
}
};
Network.prototype.destroy = function() {
// remove keybindings
this.keycharm.reset();
// clear hammer bindings
this.hammer.dispose();
// clear events
this.off();
}
/**
* Get the pointer location from a touch location
* @param {{pageX: Number, pageY: Number}} touch

Loading…
Cancel
Save