Skip to content

Commit

Permalink
Don't remove Element from DOM when calling destroy()
Browse files Browse the repository at this point in the history
  • Loading branch information
piranna committed Mar 30, 2021
1 parent 3334451 commit 37dec3c
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,19 @@ P2PGraph.prototype.destroy = function () {
var self = this
debug('destroy')

self._root.remove()
const {_model} = self

if (_model.focused) {
_model.focused = null

self.emit('select', false)
}

_model.links = []
_model.nodes = []

self._update()

window.removeEventListener('resize', self._resizeThrottled)

self._root = null
Expand Down

0 comments on commit 37dec3c

Please sign in to comment.