summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLauri Ojansivu <x@xet7.org>2017-02-22 17:39:10 +0200
committerLauri Ojansivu <x@xet7.org>2017-02-22 17:39:10 +0200
commitd45a1976953ef402a976053c700a16a207461672 (patch)
treef112189404804c172eeb6889f5e36ad3ca5e7dc0
parentb185b5ef8e7a0cec5bdb061abb8d1316c846c42f (diff)
parent365801643548d8ebf61e15f2bb7798d01a2c6296 (diff)
downloadwekan-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
-rw-r--r--client/components/boards/boardHeader.jade2
-rw-r--r--client/components/boards/boardHeader.js24
-rw-r--r--client/components/main/header.js2
-rw-r--r--i18n/en.i18n.json1
4 files changed, 20 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'),
});
diff --git a/i18n/en.i18n.json b/i18n/en.i18n.json
index b6c98152..ad74a0e0 100644
--- a/i18n/en.i18n.json
+++ b/i18n/en.i18n.json
@@ -196,6 +196,7 @@
"fullname": "Full Name",
"header-logo-title": "Go back to your boards page.",
"hide-system-messages": "Hide system messages",
+ "headerBarCreateBoardPopup-title": "Create Board",
"home": "Home",
"import": "Import",
"import-board": "import from Trello",