From 95948573df8e6c778073cf5714e5a10647e2c749 Mon Sep 17 00:00:00 2001 From: garrettmills Date: Thu, 4 Feb 2021 16:22:16 -0600 Subject: [PATCH] #83 - add loading mask to file box --- .../nodes/file-box/file-box.component.html | 16 +++++++++------- .../nodes/file-box/file-box.component.ts | 7 +++++-- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/app/components/nodes/file-box/file-box.component.html b/src/app/components/nodes/file-box/file-box.component.html index f67c24d..1e16d12 100644 --- a/src/app/components/nodes/file-box/file-box.component.html +++ b/src/app/components/nodes/file-box/file-box.component.html @@ -10,7 +10,7 @@ (click)="navigateBack(rec)" >{{ rec.name }}  / -   Folder -   Upload Files -   Open +   Folder +   Upload Files +   Open
@@ -34,6 +34,7 @@ @@ -41,8 +42,9 @@
-
No files or folders.
-
+
No files or folders.
+
Loading...
+
@@ -50,7 +52,7 @@
-
+
diff --git a/src/app/components/nodes/file-box/file-box.component.ts b/src/app/components/nodes/file-box/file-box.component.ts index fc25068..8234da7 100644 --- a/src/app/components/nodes/file-box/file-box.component.ts +++ b/src/app/components/nodes/file-box/file-box.component.ts @@ -56,6 +56,7 @@ export class FileBoxComponent extends EditorNodeContract implements OnInit { protected dirty = false; protected pendingSetup = true; + public isLoading = true; public notAvailableOffline = false; public fileBoxName = 'New File Box'; public record?: FileBoxRecord; @@ -143,12 +144,14 @@ export class FileBoxComponent extends EditorNodeContract implements OnInit { } public async loadBox(): Promise { + this.isLoading = true; this.fileBoxName = this.record.name; const files = await this.api.getFileBoxFiles(this.page.UUID, this.node.UUID, this.record.UUID); const children = await this.api.getFileBoxChildren(this.page.UUID, this.node.UUID, this.record.UUID); this.items = [...children, ...files]; this.refilter(); + this.isLoading = false; } public async navigateUp() { @@ -207,7 +210,7 @@ export class FileBoxComponent extends EditorNodeContract implements OnInit { } async onSurfaceContextMenu(event: MouseEvent) { - if ( this.readonly ) { + if ( this.readonly || this.isLoading ) { return; } @@ -266,7 +269,7 @@ export class FileBoxComponent extends EditorNodeContract implements OnInit { } async onItemContextMenu(item: FileBoxItem, event: MouseEvent) { - if ( this.readonly ) { + if ( this.readonly || this.isLoading ) { return; }