cytoscape / cytoscape.js-navigator

Bird's eye view pan and zoom control for Cytoscape.js.
MIT License
67 stars 42 forks source link

destroy() function does not remove cy listeners eg. cy.onRender #34

Closed newtask closed 6 years ago

newtask commented 6 years ago

When calling destroy() the navigator element will be deleted but the listeners are not removed. This causes the extention to render even when it's not active any more.

Test script:

<script>
   [...]
   var nav = cy.navigator({
      // options...
      });
   [...]
   function destroyNav(){
       nav.destroy();
   }
   [...]
</script>

<body>
        <h1>cytoscape-navigator demo</h1>
        <button onclick="destroyNav()">Destroy nav</button>
        <div id="cy"></div>
</body>
newtask commented 6 years ago

@maxkfranz thanks for the update!

I assume that _removeCyListeners() is private but it's never called. Maybe it should be added to _removeEventsHandling()