Add two way binding of activities, comments, and attachments

This commit is contained in:
Andrés Manelli 2018-04-18 01:35:46 -03:00
parent 49c415f023
commit 74a01691e3
4 changed files with 46 additions and 10 deletions

View file

@ -21,11 +21,18 @@ BlazeComponent.extendComponent({
'submit .js-new-comment-form'(evt) {
const input = this.getInput();
const text = input.val().trim();
const card = this.currentData();
let boardId = card.boardId;
let cardId = card._id;
if (card.isImportedCard()) {
boardId = Cards.findOne(card.importedId).boardId;
cardId = card.importedId;
}
if (text) {
CardComments.insert({
text,
boardId: this.currentData().boardId,
cardId: this.currentData()._id,
boardId,
cardId,
});
resetCommentInput(input);
Tracker.flush();