From 82c11b83857d2d2e1068cb7a825aef3e674ff983 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Mon, 4 Apr 2022 10:24:56 +0200 Subject: [PATCH 1/2] MOBILE-3833 my: Add horizontal margin on filter columns --- .../block/myoverview/components/myoverview/myoverview.scss | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/addons/block/myoverview/components/myoverview/myoverview.scss b/src/addons/block/myoverview/components/myoverview/myoverview.scss index 06c764187..2c09ff1e8 100644 --- a/src/addons/block/myoverview/components/myoverview/myoverview.scss +++ b/src/addons/block/myoverview/components/myoverview/myoverview.scss @@ -5,6 +5,8 @@ ion-col { padding: 0; + margin-right: 2px; + margin-left: 2px; } ion-button, From bb523b14134cb227677c77cc7ec874afc8dc90cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Mon, 4 Apr 2022 10:26:30 +0200 Subject: [PATCH 2/2] MOBILE-3833 collapsible: Revert to listen ionViewDidEnter again --- src/core/directives/collapsible-header.ts | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/core/directives/collapsible-header.ts b/src/core/directives/collapsible-header.ts index 887918f05..17bbc9e07 100644 --- a/src/core/directives/collapsible-header.ts +++ b/src/core/directives/collapsible-header.ts @@ -14,6 +14,7 @@ import { Directive, ElementRef, Input, OnChanges, OnDestroy, OnInit, SimpleChange } from '@angular/core'; import { CoreCancellablePromise } from '@classes/cancellable-promise'; +import { CorePromisedValue } from '@classes/promised-value'; import { CoreLoadingComponent } from '@components/loading/loading'; import { CoreTabsOutletComponent } from '@components/tabs-outlet/tabs-outlet'; import { CoreTabsComponent } from '@components/tabs/tabs'; @@ -69,12 +70,14 @@ export class CoreCollapsibleHeaderDirective implements OnInit, OnChanges, OnDest protected content?: HTMLIonContentElement; protected contentScrollListener?: EventListener; protected endContentScrollListener?: EventListener; + protected pageDidEnterListener?: EventListener; protected resizeListener?: CoreEventObserver; protected floatingTitle?: HTMLHeadingElement; protected scrollingHeight?: number; protected subscriptions: Subscription[] = []; protected enabled = true; protected isWithinContent = false; + protected enteredPromise = new CorePromisedValue(); protected mutationObserver?: MutationObserver; protected loadingFloatingTitle = false; protected visiblePromise?: CoreCancellablePromise; @@ -104,6 +107,7 @@ export class CoreCollapsibleHeaderDirective implements OnInit, OnChanges, OnDest await Promise.all([ this.initializeCollapsedHeader(), this.initializeExpandedHeader(), + await this.enteredPromise, ]); await this.initializeFloatingTitle(); @@ -138,6 +142,9 @@ export class CoreCollapsibleHeaderDirective implements OnInit, OnChanges, OnDest if (this.content && this.endContentScrollListener) { this.content.removeEventListener('ionScrollEnd', this.endContentScrollListener); } + if (this.page && this.pageDidEnterListener) { + this.page.removeEventListener('ionViewDidEnter', this.pageDidEnterListener); + } this.resizeListener?.off(); this.mutationObserver?.disconnect(); @@ -193,6 +200,22 @@ export class CoreCollapsibleHeaderDirective implements OnInit, OnChanges, OnDest // Find element and prepare classes. this.page = this.collapsedHeader.parentElement; this.page.classList.add('collapsible-header-page'); + + this.page.addEventListener( + 'ionViewDidEnter', + this.pageDidEnterListener = () => { + clearTimeout(timeout); + this.enteredPromise.resolve(); + if (this.page && this.pageDidEnterListener) { + this.page.removeEventListener('ionViewDidEnter', this.pageDidEnterListener); + } + }, + ); + + // Timeout in case event is never fired. + const timeout = window.setTimeout(() => { + this.enteredPromise.reject(new Error('[collapsible-header] Waiting for ionViewDidEnter timeout reached')); + }, 5000); } /**