diff options
Diffstat (limited to 'client/lib/modal.js')
-rw-r--r-- | client/lib/modal.js | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/client/lib/modal.js b/client/lib/modal.js index 3c27a179..1086734e 100644 --- a/client/lib/modal.js +++ b/client/lib/modal.js @@ -1,6 +1,6 @@ const closedValue = null; -window.Modal = new class { +window.Modal = new (class { constructor() { this._currentModal = new ReactiveVar(closedValue); this._onCloseGoTo = ''; @@ -21,7 +21,7 @@ window.Modal = new class { return this.getTemplateName() !== closedValue; } - isWide(){ + isWide() { return this._isWideModal; } @@ -32,23 +32,23 @@ window.Modal = new class { } } - openWide(modalName, { header = '', onCloseGoTo = ''} = {}) { + openWide(modalName, { header = '', onCloseGoTo = '' } = {}) { this._currentModal.set({ header, modalName }); this._onCloseGoTo = onCloseGoTo; this._isWideModal = true; } - open(modalName, { header = '', onCloseGoTo = ''} = {}) { + open(modalName, { header = '', onCloseGoTo = '' } = {}) { this._currentModal.set({ header, modalName }); this._onCloseGoTo = onCloseGoTo; - } -}(); +})(); Blaze.registerHelper('Modal', Modal); -EscapeActions.register('modalWindow', +EscapeActions.register( + 'modalWindow', () => Modal.close(), () => Modal.isOpen(), - { noClickEscapeOn: '.modal-container' } + { noClickEscapeOn: '.modal-container' }, ); |