Labels activities

This commit is contained in:
Angelo Gallarello 2018-08-16 16:54:29 +02:00
parent 99e7c65907
commit 9c6d374b95
19 changed files with 480 additions and 60 deletions

View file

@ -4,6 +4,7 @@ window.Modal = new class {
constructor() {
this._currentModal = new ReactiveVar(closedValue);
this._onCloseGoTo = '';
this._isWideModal = false;
}
getHeaderName() {
@ -20,6 +21,10 @@ window.Modal = new class {
return this.getTemplateName() !== closedValue;
}
isWide(){
return this._isWideModal;
}
close() {
this._currentModal.set(closedValue);
if (this._onCloseGoTo) {
@ -27,9 +32,16 @@ window.Modal = new class {
}
}
openWide(modalName, { header = '', onCloseGoTo = ''} = {}) {
this._currentModal.set({ header, modalName });
this._onCloseGoTo = onCloseGoTo;
this._isWideModal = true;
}
open(modalName, { header = '', onCloseGoTo = ''} = {}) {
this._currentModal.set({ header, modalName });
this._onCloseGoTo = onCloseGoTo;
}
}();
@ -38,5 +50,5 @@ Blaze.registerHelper('Modal', Modal);
EscapeActions.register('modalWindow',
() => Modal.close(),
() => Modal.isOpen(),
{ noClickEscapeOn: '.modal-content' }
{ noClickEscapeOn: '.modal-container' }
);