From f888cfd565b197903c24a07221f6a6a44e1b6223 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Manelli?= Date: Sat, 23 Feb 2019 20:41:36 +0100 Subject: Allow list creation from template --- client/components/swimlanes/swimlanes.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'client/components/swimlanes/swimlanes.js') diff --git a/client/components/swimlanes/swimlanes.js b/client/components/swimlanes/swimlanes.js index 63266e5f..bdaed81d 100644 --- a/client/components/swimlanes/swimlanes.js +++ b/client/components/swimlanes/swimlanes.js @@ -154,6 +154,8 @@ BlazeComponent.extendComponent({ BlazeComponent.extendComponent({ onCreated() { + currentBoard = Boards.findOne(Session.get('currentBoard')); + this.isListTemplatesSwimlane = currentBoard.isTemplatesBoard() && this.currentData().isListTemplatesSwimlane(); this.currentSwimlane = this.currentData(); }, @@ -169,19 +171,19 @@ BlazeComponent.extendComponent({ const titleInput = this.find('.list-name-input'); const title = titleInput.value.trim(); if (title) { - const listType = (this.currentSwimlane.isListTemplatesSwimlane())?'template-list':'list'; Lists.insert({ title, boardId: Session.get('currentBoard'), sort: $('.list').length, - type: listType, - swimlaneId: this.currentSwimlane._id, + type: (this.isListTemplatesSwimlane)?'template-list':'list', + swimlaneId: (this.isListTemplatesSwimlane)?this.currentSwimlane._id:'', }); titleInput.value = ''; titleInput.focus(); } }, + 'click .js-list-template': Popup.open('searchCard'), }]; }, }).register('addListForm'); -- cgit v1.2.3-1-g7c22