LP#1827942: follow-up to fix a couple issues
authorGalen Charlton <gmc@equinoxinitiative.org>
Fri, 27 Dec 2019 16:04:32 +0000 (11:04 -0500)
committerGalen Charlton <gmc@equinoxinitiative.org>
Fri, 27 Dec 2019 16:04:32 +0000 (11:04 -0500)
[1] Sets a default value for the modal options for dialogs such
    as ProgressDialog that do not supply any value for the
    options parameter; otherwise, progress dialogs would not
    appear at all.
[2] Fix lint warnings.

Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Open-ILS/src/eg2/src/app/share/dialog/dialog.component.ts

index 27b611f..866adec 100644 (file)
@@ -76,14 +76,16 @@ export class DialogComponent implements OnInit {
         this.onOpen$ = new EventEmitter<any>();
     }
 
-    open(options?: NgbModalOptions): Observable<any> {
+    open(options: NgbModalOptions = { backdrop: 'static' }): Observable<any> {
 
         if (this.modalRef !== null) {
             this.error('Dialog was replaced!');
             this.finalize();
         }
 
-        options.backdrop="static";
+        // force backdrop to static if caller passed in any options
+        options.backdrop = 'static';
+
         this.modalRef = this.modalService.open(this.dialogContent, options);
         DialogComponent.instances[this.identifier] = this;