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:
parent
9b2f081ef2
commit
03402d9e4d
4 changed files with 15 additions and 4 deletions
|
@ -34,6 +34,10 @@ export default Ember.Component.extend({
|
|||
this.sizeSidebar();
|
||||
},
|
||||
|
||||
willDestroyElement() {
|
||||
this.eventBus.unsubscribe('resized');
|
||||
},
|
||||
|
||||
sizeSidebar() {
|
||||
let size = $(window).height() - 200;
|
||||
this.$('.document-history > .sidebar').css('height', size + "px");
|
||||
|
|
|
@ -42,6 +42,8 @@ export default Ember.Component.extend(TooltipMixin, NotifierMixin, {
|
|||
},
|
||||
|
||||
willDestroyElement() {
|
||||
this.eventBus.unsubscribe('resized');
|
||||
this.eventBus.unsubscribe('scrolled');
|
||||
this.destroyTooltips();
|
||||
},
|
||||
|
||||
|
|
|
@ -80,6 +80,12 @@ export default Ember.Component.extend(TooltipMixin, NotifierMixin, {
|
|||
this.eventBus.subscribe('scrolled', this, 'positionTool');
|
||||
},
|
||||
|
||||
willDestroyElement() {
|
||||
this.eventBus.unsubscribe('resized');
|
||||
this.eventBus.unsubscribe('scrolled');
|
||||
this.destroyTooltips();
|
||||
},
|
||||
|
||||
didReceiveAttrs() {
|
||||
let folders = this.get('folders');
|
||||
|
||||
|
@ -111,10 +117,6 @@ export default Ember.Component.extend(TooltipMixin, NotifierMixin, {
|
|||
this.set('hasProtectedFolders', this.get('protectedFolders.length') > 0);
|
||||
},
|
||||
|
||||
willDestroyElement() {
|
||||
this.destroyTooltips();
|
||||
},
|
||||
|
||||
positionTool() {
|
||||
if (this.get('isDestroyed') || this.get('isDestroying')) {
|
||||
return;
|
||||
|
|
|
@ -128,6 +128,9 @@ export default Ember.Component.extend(TooltipMixin, {
|
|||
sortable.destroy();
|
||||
}
|
||||
|
||||
this.eventBus.unsubscribe('resized');
|
||||
this.eventBus.unsubscribe('pinChange');
|
||||
|
||||
this.destroyTooltips();
|
||||
},
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue