From 989b026b33508feaa6ba806a624b95a93298327c Mon Sep 17 00:00:00 2001 From: Nicu Tofan Date: Sun, 24 Jun 2018 10:44:09 +0300 Subject: Can now navigate to subtask --- client/components/cards/subtasks.jade | 1 + client/components/cards/subtasks.js | 11 +++++++++++ client/components/cards/subtasks.styl | 3 +++ 3 files changed, 15 insertions(+) (limited to 'client/components/cards') diff --git a/client/components/cards/subtasks.jade b/client/components/cards/subtasks.jade index 5bf6c7ce..b0ef2f33 100644 --- a/client/components/cards/subtasks.jade +++ b/client/components/cards/subtasks.jade @@ -24,6 +24,7 @@ template(name="subtaskDetail") else .subtask-title span + a.js-view-subtask(title="{{ subtask.title }}") {{_ "view-it"}} if canModifyCard a.js-delete-subtask.toggle-delete-subtask-dialog {{_ "delete"}}... diff --git a/client/components/cards/subtasks.js b/client/components/cards/subtasks.js index 9a6666a3..087824f7 100644 --- a/client/components/cards/subtasks.js +++ b/client/components/cards/subtasks.js @@ -88,6 +88,17 @@ BlazeComponent.extendComponent({ } this.toggleDeleteDialog.set(!this.toggleDeleteDialog.get()); }, + 'click .js-view-subtask'(event) { + if($(event.target).hasClass('js-view-subtask')){ + const subtask = this.currentData().subtask; + const board = subtask.board(); + FlowRouter.go('card', { + boardId: board._id, + slug: board.slug, + cardId: subtask._id, + }); + } + }, }; return [{ diff --git a/client/components/cards/subtasks.styl b/client/components/cards/subtasks.styl index 5bb2d4bd..c2f09aa1 100644 --- a/client/components/cards/subtasks.styl +++ b/client/components/cards/subtasks.styl @@ -37,7 +37,10 @@ textarea.js-add-subtask-item, textarea.js-edit-subtask-item .js-delete-subtask @extends .delete-text + margin: 0 0.5em + .js-view-subtask + @extends .delete-text .js-confirm-subtask-delete background-color: darken(white, 3%) -- cgit v1.2.3-1-g7c22