From 71b9a42f00d8871bb09944ec80979c61ad84e655 Mon Sep 17 00:00:00 2001 From: Maxime Quandalle Date: Tue, 8 Dec 2015 16:05:59 -0500 Subject: Allow the header bar customization This commit also provide a way to escape the Shorcuts page on Sandstorm. --- client/lib/modal.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'client/lib') diff --git a/client/lib/modal.js b/client/lib/modal.js index e6301cb5..1ca8804b 100644 --- a/client/lib/modal.js +++ b/client/lib/modal.js @@ -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; } }; -- cgit v1.2.3-1-g7c22