From 9c3fa60551eac1a35877dc159ebeb31f858de0ca Mon Sep 17 00:00:00 2001 From: Terry Truong Date: Thu, 7 Jul 2022 19:51:32 +1000 Subject: Adapt loading-modal to show other messages Was intending to add 'Arranging tiles' and 'Rendering tiles' messages, but they wouldn't trigger during 'uncontrived' test cases, including with throttled CPU --- src/App.vue | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) (limited to 'src/App.vue') diff --git a/src/App.vue b/src/App.vue index 29df31b..f8c986e 100644 --- a/src/App.vue +++ b/src/App.vue @@ -51,7 +51,7 @@ + @net-wait="primeLoadInd('Loading data')" @net-get="endLoadInd" class="z-10" ref="searchModal"/> - +
0){ - this.relayoutWithCollapse(false); // Second pass for regularity + success = this.relayoutWithCollapse(false); // Second pass for regularity } else { - await this.onLeafClick(layoutNode, true); + success = await this.onLeafClick(layoutNode, true); } } else { success = await this.onNonleafClick(layoutNode, true); // For reducing tile-flashing on-screen @@ -799,23 +799,21 @@ export default defineComponent({ }, // For the loading-indicator async loadFromServer(urlParams: URLSearchParams){ // Like queryServer(), but enables the loading indicator - this.primeLoadInd(); + this.primeLoadInd('Loading data'); let responseObj = await queryServer(urlParams); this.endLoadInd(); return responseObj; }, - primeLoadInd(){ - if (this.pendingLoadingRevealHdlr == 0){ - this.pendingLoadingRevealHdlr = setTimeout(() => { - this.loadingOpen = true; - }, 300); - } + primeLoadInd(msg: string){ + this.pendingLoadingRevealHdlr = setTimeout(() => { + this.loadingMsg = msg; + }, 300); }, endLoadInd(){ clearTimeout(this.pendingLoadingRevealHdlr); this.pendingLoadingRevealHdlr = 0; - if (this.loadingOpen){ - this.loadingOpen = false; + if (this.loadingMsg != null){ + this.loadingMsg = null; } }, // For other events -- cgit v1.2.3