Allow the header bar customization

This commit also provide a way to escape the Shorcuts page on
Sandstorm.
This commit is contained in:
Maxime Quandalle 2015-12-08 16:05:59 -05:00
parent 3b2eb0ffa1
commit 71b9a42f00
12 changed files with 98 additions and 50 deletions

View file

@ -6,8 +6,14 @@ window.Modal = new class {
this._onCloseGoTo = '';
}
getHeaderName() {
const currentModal = this._currentModal.get();
return currentModal && currentModal.header;
}
getTemplateName() {
return this._currentModal.get();
const currentModal = this._currentModal.get();
return currentModal && currentModal.modalName;
}
isOpen() {
@ -21,8 +27,8 @@ window.Modal = new class {
}
}
open(modalName, { onCloseGoTo = ''} = {}) {
this._currentModal.set(modalName);
open(modalName, { header = '', onCloseGoTo = ''} = {}) {
this._currentModal.set({ header, modalName });
this._onCloseGoTo = onCloseGoTo;
}
};