diff options
author | Joel Louzado <jlouzado@gmail.com> | 2017-02-22 17:33:17 +0530 |
---|---|---|
committer | Joel Louzado <jlouzado@gmail.com> | 2017-02-22 17:33:17 +0530 |
commit | ac07646749d9838e70c728232078164551309ce5 (patch) | |
tree | be0f6c58461e044ff8f785005ef2e149b69fb9fa /client/components | |
parent | cd70076af2b0d34c2fb4a0ef52c02c8f9da28a69 (diff) | |
download | wekan-ac07646749d9838e70c728232078164551309ce5.tar.gz wekan-ac07646749d9838e70c728232078164551309ce5.tar.bz2 wekan-ac07646749d9838e70c728232078164551309ce5.zip |
New component for use in header-bar
Diffstat (limited to 'client/components')
-rw-r--r-- | client/components/boards/boardHeader.jade | 2 | ||||
-rw-r--r-- | client/components/boards/boardHeader.js | 20 |
2 files changed, 16 insertions, 6 deletions
diff --git a/client/components/boards/boardHeader.jade b/client/components/boards/boardHeader.jade index 033d240a..599ad20a 100644 --- a/client/components/boards/boardHeader.jade +++ b/client/components/boards/boardHeader.jade @@ -170,7 +170,7 @@ template(name="boardChangeColorPopup") if isSelected i.fa.fa-check -template(name="createBoardPopup") +template(name="createBoard") form label | {{_ 'title'}} diff --git a/client/components/boards/boardHeader.js b/client/components/boards/boardHeader.js index a76b566a..7c57ef42 100644 --- a/client/components/boards/boardHeader.js +++ b/client/components/boards/boardHeader.js @@ -119,10 +119,15 @@ BlazeComponent.extendComponent({ }, }).register('boardChangeColorPopup'); -BlazeComponent.extendComponent({ +const CreateBoard = BlazeComponent.extendComponent({ + template() { + return 'createBoard'; + }, + onCreated() { this.visibilityMenuIsOpen = new ReactiveVar(false); this.visibility = new ReactiveVar('private'); + const boardId = ''; }, visibilityCheck() { @@ -143,15 +148,12 @@ BlazeComponent.extendComponent({ const title = this.find('.js-new-board-title').value; const visibility = this.visibility.get(); - const boardId = Boards.insert({ + boardId = Boards.insert({ title, permission: visibility, }); Utils.goBoardId(boardId); - - // Immediately star boards crated with the headerbar popup. - Meteor.user().toggleBoardStar(boardId); }, events() { @@ -166,6 +168,14 @@ BlazeComponent.extendComponent({ }, }).register('createBoardPopup'); +(class HeaderBarCreateBoard extends CreateBoard { + onSubmit(evt) { + super.onSubmit(evt); + // Immediately star boards crated with the headerbar popup. + Meteor.user().toggleBoardStar(boardId); + } +}).register('headerBarCreateBoardPopup') + BlazeComponent.extendComponent({ visibilityCheck() { const currentBoard = Boards.findOne(Session.get('currentBoard')); |