LP1849137 Catalog Patron View loading icon
authorBill Erickson <berickxx@gmail.com>
Tue, 29 Oct 2019 17:54:26 +0000 (13:54 -0400)
committerJane Sandberg <sandbej@linnbenton.edu>
Tue, 29 Oct 2019 19:22:01 +0000 (12:22 -0700)
Display the usual loading circle icon while the embedded patron view
iframe is loading.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Jane Sandberg <sandbej@linnbenton.edu>
Open-ILS/src/eg2/src/app/staff/catalog/record/opac.component.html
Open-ILS/src/eg2/src/app/staff/catalog/record/opac.component.ts

index 8a67300..adbaeec 100644 (file)
@@ -1,4 +1,8 @@
 
+<div *ngIf="!loaded" class="m-3 p-3 d-flex justify-content-center">
+  <div><img src="/images/progressbar_green.gif"/></div>
+</div>
+
 <ng-container *ngIf="url">
   <iframe id='opac-iframe' class="w-100" (load)="handleLoad()" [src]="url">
   </iframe> 
index 4a5bd03..98eadf3 100644 (file)
@@ -10,6 +10,7 @@ const OPAC_BASE_URL = '/eg/opac/record';
 export class OpacViewComponent {
 
     url; // SafeResourceUrlImpl
+    loaded: boolean;
 
     _recordId: number;
     @Input() set recordId(id: number) {
@@ -40,6 +41,7 @@ export class OpacViewComponent {
         const height = 50 + iframe.contentWindow.document.body.offsetHeight;
 
         iframe.style.height = `${height}px`;
+        this.loaded = true;
     }
 }