Ver código fonte

Can now navigate to subtask

Nicu Tofan 7 anos atrás
pai
commit
989b026b33

+ 1 - 0
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"}}...
 

+ 11 - 0
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 [{

+ 3 - 0
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%)