diff options
author | Lauri Ojansivu <x@xet7.org> | 2017-02-22 17:39:10 +0200 |
---|---|---|
committer | Lauri Ojansivu <x@xet7.org> | 2017-02-22 17:39:10 +0200 |
commit | d45a1976953ef402a976053c700a16a207461672 (patch) | |
tree | f112189404804c172eeb6889f5e36ad3ca5e7dc0 /client/components | |
parent | b185b5ef8e7a0cec5bdb061abb8d1316c846c42f (diff) | |
parent | 365801643548d8ebf61e15f2bb7798d01a2c6296 (diff) | |
download | wekan-d45a1976953ef402a976053c700a16a207461672.tar.gz wekan-d45a1976953ef402a976053c700a16a207461672.tar.bz2 wekan-d45a1976953ef402a976053c700a16a207461672.zip |
Merge branch 'jLouzado-bAutoStarBoard' into devel
Only header-bar new-boards are auto-starred
Closes #847
Diffstat (limited to 'client/components')
-rw-r--r-- | client/components/boards/boardHeader.jade | 2 | ||||
-rw-r--r-- | client/components/boards/boardHeader.js | 24 | ||||
-rw-r--r-- | client/components/main/header.js | 2 |
3 files changed, 19 insertions, 9 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..9b03ab56 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'); + this.boardId = new ReactiveVar(''); }, 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({ + this.boardId.set(Boards.insert({ title, permission: visibility, - }); - - Utils.goBoardId(boardId); + })); - // Immediately star boards crated with the headerbar popup. - Meteor.user().toggleBoardStar(boardId); + Utils.goBoardId(this.boardId.get()); }, 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(this.boardId.get()); + } +}).register('headerBarCreateBoardPopup'); + BlazeComponent.extendComponent({ visibilityCheck() { const currentBoard = Boards.findOne(Session.get('currentBoard')); diff --git a/client/components/main/header.js b/client/components/main/header.js index 0337c72b..49acbfef 100644 --- a/client/components/main/header.js +++ b/client/components/main/header.js @@ -13,5 +13,5 @@ Template.header.helpers({ }); Template.header.events({ - 'click .js-create-board': Popup.open('createBoard'), + 'click .js-create-board': Popup.open('headerBarCreateBoard'), }); |