diff --git a/app/components/architecture-viewer.js b/app/components/architecture-viewer.js index ad39f5841d87dec46b428b808c4553f7f65e2612..d306e7afed718607c11d77becc3144dbafd40661 100644 --- a/app/components/architecture-viewer.js +++ b/app/components/architecture-viewer.js @@ -17,14 +17,22 @@ export default Ember.Component.extend({ 'concentric', 'breadthfirst' ], + resizing: false, init() { this._super(); this.debug('init!', this.get('graph'), this.get('layoutAlgorithm')); // add class while the sidebar grows const visualisationEvents = this.get('visualisationEvents'); - visualisationEvents.on('resize:start', () => this.set('resizing', true)); - visualisationEvents.on('resize:end', () => this.set('resizing', false)); + const startListener = () => this.set('resizing', true); + const endListener = () => this.set('resizing', false); + visualisationEvents.on('resize:start', startListener); + visualisationEvents.on('resize:end', endListener); + + this.on('willDestroyElement', () => { + visualisationEvents.off('resize:start', startListener); + visualisationEvents.off('resize:end', endListener); + }); }, actions: { selectLayoutAlgorithm(value) { diff --git a/app/components/architecture-visualisation-cytoscape/component.js b/app/components/architecture-visualisation-cytoscape/component.js index 8d1fb250d521f08ba306594327e8749a360fc3d7..dc0bf6cdca55c1812cf99cd88258ba5ec85c152e 100644 --- a/app/components/architecture-visualisation-cytoscape/component.js +++ b/app/components/architecture-visualisation-cytoscape/component.js @@ -19,7 +19,12 @@ export default Ember.Component.extend({ this.debug('loaded', this.get('graph')); // we only need to listen to :end since opacity changes are done via css, since architecture-viewer adds a resizing class - this.get('visualisationEvents').on('resize:end', this.resize.bind(this)); + const visualisationEvents = this.get('visualisationEvents'); + const resizeListener = this.resize.bind(this); + visualisationEvents.on('resize:end', resizeListener); + this.on('willDestroyElement', () => { + visualisationEvents.off('resize:start', resizeListener); + }); }, willDestroyElement() { clearInterval(this.interval);