MOBILE-3833 core: Add collapsible header listeners

main
Noel De Martin 2022-03-09 09:53:12 +01:00
parent 0a24df0f28
commit b69e2ac8b7
1 changed files with 8 additions and 0 deletions

View File

@ -190,6 +190,9 @@ export class CoreCollapsibleHeaderDirective implements OnInit, OnChanges, OnDest
}; };
this.subscriptions.push(outlet.activateEvents.subscribe(onOutletUpdated)); this.subscriptions.push(outlet.activateEvents.subscribe(onOutletUpdated));
this.subscriptions.push(outlet.activateEvents.subscribe(onOutletUpdated));
onOutletUpdated();
onOutletUpdated(); onOutletUpdated();
@ -311,6 +314,10 @@ export class CoreCollapsibleHeaderDirective implements OnInit, OnChanges, OnDest
* @param content Content element. * @param content Content element.
*/ */
protected updateContent(content?: HTMLIonContentElement | null): void { protected updateContent(content?: HTMLIonContentElement | null): void {
if (content === (this.content ?? null)) {
return;
}
if (this.content) { if (this.content) {
if (this.contentScrollListener) { if (this.contentScrollListener) {
this.content.removeEventListener('ionScroll', this.contentScrollListener); this.content.removeEventListener('ionScroll', this.contentScrollListener);
@ -321,6 +328,7 @@ export class CoreCollapsibleHeaderDirective implements OnInit, OnChanges, OnDest
this.content.removeEventListener('ionScrollEnd', this.endContentScrollListener); this.content.removeEventListener('ionScrollEnd', this.endContentScrollListener);
delete this.endContentScrollListener; delete this.endContentScrollListener;
} }
delete this.content; delete this.content;
} }