mirror of
https://github.com/documize/community.git
synced 2025-07-20 21:59:42 +02:00
added missing event subscription teardowns
This commit is contained in:
parent
9b2f081ef2
commit
03402d9e4d
4 changed files with 15 additions and 4 deletions
|
@ -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");
|
||||||
|
|
|
@ -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();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue