diff options
Diffstat (limited to 'client/components/cards')
-rw-r--r-- | client/components/cards/attachments.jade | 4 | ||||
-rw-r--r-- | client/components/cards/attachments.js | 8 | ||||
-rw-r--r-- | client/components/cards/checklists.js | 4 |
3 files changed, 11 insertions, 5 deletions
diff --git a/client/components/cards/attachments.jade b/client/components/cards/attachments.jade index c8442691..0f79323b 100644 --- a/client/components/cards/attachments.jade +++ b/client/components/cards/attachments.jade @@ -21,8 +21,8 @@ template(name="attachmentDeletePopup") template(name="attachmentsGalery") .attachments-galery each attachments - a.attachment-item.swipebox(href="{{url}}" title="{{name}}") - .attachment-thumbnail + .attachment-item + a.attachment-thumbnail.swipebox(href="{{url}}" title="{{name}}") if isUploaded if isImage img.attachment-thumbnail-img(src="{{url}}") 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(); }); }, diff --git a/client/components/cards/checklists.js b/client/components/cards/checklists.js index d3a946f0..5c0e3d2e 100644 --- a/client/components/cards/checklists.js +++ b/client/components/cards/checklists.js @@ -181,8 +181,8 @@ BlazeComponent.extendComponent({ Template.checklistDeleteDialog.onCreated(() => { const $cardDetails = this.$('.card-details'); this.scrollState = { position: $cardDetails.scrollTop(), //save current scroll position - top: false, //required for smooth scroll animation - }; + top: false, //required for smooth scroll animation + }; //Callback's purpose is to only prevent scrolling after animation is complete $cardDetails.animate({ scrollTop: 0 }, 500, () => { this.scrollState.top = true; }); |