Browse Source

Fix TypeError when closing a dialog (#160)

Fixes #153
Danilo Bargen 8 years ago
parent
commit
e930075356
1 changed files with 6 additions and 7 deletions
  1. 6 7
      src/partials/messenger.ts

+ 6 - 7
src/partials/messenger.ts

@@ -31,7 +31,7 @@ import {StateService} from '../services/state';
 import {WebClientService} from '../services/webclient';
 import {ControllerModelMode} from '../types/enums';
 
-abstract class DialogController {
+class DialogController {
     public static $inject = ['$mdDialog'];
 
     public $mdDialog: ng.material.IDialogService;
@@ -58,11 +58,14 @@ abstract class DialogController {
             this.activeElement.focus();
         }
     }
+
     /**
      * If true, the focus on the active element (before opening the dialog)
-     * will be restored.
+     * will be restored. Default `true`, override if desired.
      */
-    protected abstract resumeFocusOnClose(): boolean;
+    protected resumeFocusOnClose(): boolean {
+        return true;
+    }
 }
 
 /**
@@ -84,10 +87,6 @@ class SendFileController extends DialogController {
             this.send();
         }
     }
-
-    protected resumeFocusOnClose(): boolean {
-        return true;
-    }
 }
 
 /**