diff options
author | Lauri Ojansivu <x@xet7.org> | 2017-12-11 22:08:17 +0200 |
---|---|---|
committer | Lauri Ojansivu <x@xet7.org> | 2017-12-11 22:08:17 +0200 |
commit | 7214e4bb2f66c648d45cc1f4faf3c341c9a2144c (patch) | |
tree | 876761783f4e7f7e12b18a0016a1867bc838f721 | |
parent | a282a38ecdc4a4c22af2e069a2809b3dac392262 (diff) | |
parent | fd7a140429425fbc6c5cffc8d12f2da03e950e13 (diff) | |
download | wekan-7214e4bb2f66c648d45cc1f4faf3c341c9a2144c.tar.gz wekan-7214e4bb2f66c648d45cc1f4faf3c341c9a2144c.tar.bz2 wekan-7214e4bb2f66c648d45cc1f4faf3c341c9a2144c.zip |
Merge branch 'thuanpq-auto-update-card-cover-with-latest-uploaded-image' into devel
-rw-r--r-- | CHANGELOG.md | 1 | ||||
-rw-r--r-- | client/components/cards/attachments.js | 8 |
2 files changed, 8 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 97497b7a..8517746a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ This release adds the following new features: * [Change password of any user in Standalone Wekan Admin Panel](https://github.com/wekan/wekan/pull/1372); * [Performance optimization: Move more global subscriptions to template subscription](https://github.com/wekan/wekan/pull/1373); +* [Auto update card cover with latest uploaded image attachment](https://github.com/wekan/wekan/pull/1387). * Update tranlations. Add Latvian language; * Update to Meteor 1.6.0, Node 6.12.2 and MongoDB 3.2.18. diff --git a/client/components/cards/attachments.js b/client/components/cards/attachments.js index 36e8a5ec..b1f88bf1 100644 --- a/client/components/cards/attachments.js +++ b/client/components/cards/attachments.js @@ -60,7 +60,13 @@ Template.cardAttachmentsPopup.events({ file.boardId = card.boardId; file.cardId = card._id; file.userId = Meteor.userId(); - Attachments.insert(file); + + const attachment = Attachments.insert(file); + + if (attachment && attachment._id && attachment.isImage()) { + card.setCover(attachment._id); + } + Popup.close(); }); }, |