diff --git a/dashboard/menu/menu.component.ts b/dashboard/menu/menu.component.ts index 9f89224b..d756a77f 100644 --- a/dashboard/menu/menu.component.ts +++ b/dashboard/menu/menu.component.ts @@ -372,8 +372,10 @@ export class MenuComponent implements OnInit { } public valueChange() { + this.elements.disable(); this.cdr.detectChanges(); this.elements.init(); + this.elements.enable(); } public get displayMenuItems() { diff --git a/monitor-admin/topic/topic.component.html b/monitor-admin/topic/topic.component.html index c264fee7..9e7e1bed 100644 --- a/monitor-admin/topic/topic.component.html +++ b/monitor-admin/topic/topic.component.html @@ -222,10 +222,6 @@ [queryParams]="{view: 'RESTRICTED'}" (click)="hide(element)">Restricted view - diff --git a/monitor-admin/topic/topic.component.ts b/monitor-admin/topic/topic.component.ts index 9c42c135..a7308db8 100644 --- a/monitor-admin/topic/topic.component.ts +++ b/monitor-admin/topic/topic.component.ts @@ -242,18 +242,30 @@ export class TopicComponent extends StakeholderBaseComponent implements OnInit, } topicChanged(callback: Function, save: boolean = false) { + if(this.topics && save) { + this.topics.disable(); + } + if(this.categories) { + this.categories.disable(); + } + if(this.subCategories) { + this.subCategories.disable(); + } if(callback) { callback(); } this.cdr.detectChanges(); if(this.topics && save) { this.topics.init(); + this.topics.enable(); } if(this.categories) { this.categories.init(); + this.categories.enable(); } if(this.subCategories) { this.subCategories.init(); + this.subCategories.enable(); } } @@ -378,15 +390,23 @@ export class TopicComponent extends StakeholderBaseComponent implements OnInit, } categoryChanged(callback: Function, save: boolean = false) { + if(this.categories && save) { + this.categories.disable(); + } + if(this.subCategories) { + this.subCategories.disable(); + } if(callback) { callback(); } this.cdr.detectChanges(); if(this.categories && save) { this.categories.init(); + this.categories.enable(); } if(this.subCategories) { this.subCategories.init(); + this.subCategories.enable(); } } @@ -512,12 +532,16 @@ export class TopicComponent extends StakeholderBaseComponent implements OnInit, } subCategoryChanged(callback: Function, save: boolean = false) { + if(this.subCategories && save) { + this.subCategories.disable(); + } if(callback) { callback(); } this.cdr.detectChanges(); if(this.subCategories && save) { this.subCategories.init(); + this.subCategories.enable(); } } diff --git a/utils/transition-group/transition-group.component.ts b/utils/transition-group/transition-group.component.ts index 8cea910d..e5d9a484 100644 --- a/utils/transition-group/transition-group.component.ts +++ b/utils/transition-group/transition-group.component.ts @@ -30,13 +30,14 @@ export class TransitionGroupComponent implements AfterViewInit, OnDestroy { @Input() public id: string; public size: number; + private disabled: boolean = false; private subscription: Subscription; constructor(public element: ElementRef) {} ngAfterViewInit() { this.subscription = this.items.changes.subscribe(items => { - if(items.length === this.size) { + if(items.length === this.size && !this.disabled) { items.forEach(item => item.prevPos = item.newPos || item.prevPos); items.forEach(this.runCallback); this.refreshPosition('newPos'); @@ -126,17 +127,17 @@ export class TransitionGroupComponent implements AfterViewInit, OnDestroy { /** * Enable transition - * @deprecated + * * */ enable() { - console.debug('Deprecated') + this.disabled = false; } /** * Disable transition - * @deprecated + * * */ disable() { - console.debug('Deprecated') + this.disabled = true; } }