mirror of
https://github.com/wekan/wekan.git
synced 2025-04-24 05:57:13 -04:00
New component for use in header-bar
This commit is contained in:
parent
cd70076af2
commit
ac07646749
2 changed files with 16 additions and 6 deletions
|
@ -170,7 +170,7 @@ template(name="boardChangeColorPopup")
|
|||
if isSelected
|
||||
i.fa.fa-check
|
||||
|
||||
template(name="createBoardPopup")
|
||||
template(name="createBoard")
|
||||
form
|
||||
label
|
||||
| {{_ 'title'}}
|
||||
|
|
|
@ -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'));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue