1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-20 13:49:42 +02:00

added missing event subscription teardowns

This commit is contained in:
Harvey Kandola 2017-01-24 08:48:27 -08:00
parent 9b2f081ef2
commit 03402d9e4d
4 changed files with 15 additions and 4 deletions

View file

@ -34,6 +34,10 @@ export default Ember.Component.extend({
this.sizeSidebar(); this.sizeSidebar();
}, },
willDestroyElement() {
this.eventBus.unsubscribe('resized');
},
sizeSidebar() { sizeSidebar() {
let size = $(window).height() - 200; let size = $(window).height() - 200;
this.$('.document-history > .sidebar').css('height', size + "px"); this.$('.document-history > .sidebar').css('height', size + "px");

View file

@ -42,6 +42,8 @@ export default Ember.Component.extend(TooltipMixin, NotifierMixin, {
}, },
willDestroyElement() { willDestroyElement() {
this.eventBus.unsubscribe('resized');
this.eventBus.unsubscribe('scrolled');
this.destroyTooltips(); this.destroyTooltips();
}, },

View file

@ -80,6 +80,12 @@ export default Ember.Component.extend(TooltipMixin, NotifierMixin, {
this.eventBus.subscribe('scrolled', this, 'positionTool'); this.eventBus.subscribe('scrolled', this, 'positionTool');
}, },
willDestroyElement() {
this.eventBus.unsubscribe('resized');
this.eventBus.unsubscribe('scrolled');
this.destroyTooltips();
},
didReceiveAttrs() { didReceiveAttrs() {
let folders = this.get('folders'); let folders = this.get('folders');
@ -111,10 +117,6 @@ export default Ember.Component.extend(TooltipMixin, NotifierMixin, {
this.set('hasProtectedFolders', this.get('protectedFolders.length') > 0); this.set('hasProtectedFolders', this.get('protectedFolders.length') > 0);
}, },
willDestroyElement() {
this.destroyTooltips();
},
positionTool() { positionTool() {
if (this.get('isDestroyed') || this.get('isDestroying')) { if (this.get('isDestroyed') || this.get('isDestroying')) {
return; return;

View file

@ -128,6 +128,9 @@ export default Ember.Component.extend(TooltipMixin, {
sortable.destroy(); sortable.destroy();
} }
this.eventBus.unsubscribe('resized');
this.eventBus.unsubscribe('pinChange');
this.destroyTooltips(); this.destroyTooltips();
}, },