From b27a49a0a9c42f09e29632d4eeffbd477715ef23 Mon Sep 17 00:00:00 2001 From: David Arnold Date: Thu, 17 Sep 2020 00:29:16 -0500 Subject: [PATCH] Rem: unused previewAttachedImagePopup --- client/components/cards/attachments.jade | 3 --- client/components/cards/attachments.js | 31 ------------------------ client/components/cards/attachments.styl | 5 ---- 3 files changed, 39 deletions(-) diff --git a/client/components/cards/attachments.jade b/client/components/cards/attachments.jade index f966ee89e..dfdd694e1 100644 --- a/client/components/cards/attachments.jade +++ b/client/components/cards/attachments.jade @@ -11,9 +11,6 @@ template(name="previewClipboardImagePopup") img.preview-clipboard-image() button.primary.js-upload-pasted-image {{_ 'upload'}} -template(name="previewAttachedImagePopup") - img.preview-large-image.js-large-image-clicked(src="{{url}}") - template(name="attachmentDeletePopup") p {{_ "attachment-delete-pop"}} button.js-confirm.negate.full(type="submit") {{_ 'delete'}} diff --git a/client/components/cards/attachments.js b/client/components/cards/attachments.js index f13202e18..1235ecd75 100644 --- a/client/components/cards/attachments.js +++ b/client/components/cards/attachments.js @@ -18,37 +18,6 @@ Template.attachmentsGalery.events({ 'click .js-remove-cover'() { Cards.findOne(this.meta.cardId).unsetCover(); }, - 'click .js-preview-image'(event) { - Popup.open('previewAttachedImage').call(this, event); - // when multiple thumbnails, if click one then another very fast, - // we might get a wrong width from previous img. - // when popup reused, onRendered() won't be called, so we cannot get there. - // here make sure to get correct size when this img fully loaded. - const img = $('img.preview-large-image')[0]; - if (!img) return; - const rePosPopup = () => { - const w = img.width; - const h = img.height; - // if the image is too large, we resize & center the popup. - if (w > 300) { - $('div.pop-over').css({ - width: w + 20, - position: 'absolute', - left: (window.innerWidth - w) / 2, - top: (window.innerHeight - h) / 2, - }); - } - }; - const url = $(event.currentTarget).attr('src'); - if (img.src === url && img.complete) rePosPopup(); - else img.onload = rePosPopup; - }, -}); - -Template.previewAttachedImagePopup.events({ - 'click .js-large-image-clicked'() { - Popup.close(); - }, }); Template.cardAttachmentsPopup.events({ diff --git a/client/components/cards/attachments.styl b/client/components/cards/attachments.styl index 4a22fd8a3..2b0e398f5 100644 --- a/client/components/cards/attachments.styl +++ b/client/components/cards/attachments.styl @@ -51,11 +51,6 @@ display: block box-shadow: 0 1px 2px rgba(0,0,0,.2) -.preview-large-image - max-width: 1000px - display: block - box-shadow: 0 1px 2px rgba(0,0,0,.2) - .preview-clipboard-image width: 280px max-width: 100%;