From 47380244b827a79426ea92d5a96374b72c5b0811 Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Sat, 3 Jun 2023 17:53:56 -0400 Subject: [PATCH] Set card attachment as background image. Part 4. Thanks to xet7 ! Related #486 --- client/components/cards/attachments.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/client/components/cards/attachments.js b/client/components/cards/attachments.js index 281e693ab..99b2e6c15 100644 --- a/client/components/cards/attachments.js +++ b/client/components/cards/attachments.js @@ -197,14 +197,17 @@ BlazeComponent.extendComponent({ Popup.back(); }, 'click .js-add-background-image'() { - Utils.setBackgroundImage($(".attachment-thumbnail-img").attr("src")); + const currentBoard = Boards.findOne(Session.get('currentBoard')); + const url=$(".attachment-thumbnail-img").attr("src"); + currentBoard.setBackgroundImageURL(url); + Utils.setBackgroundImage(url); Popup.back(); event.preventDefault(); }, 'click .js-remove-background-image'() { const currentBoard = Boards.findOne(Session.get('currentBoard')); currentBoard.setBackgroundImageURL(""); - Utils.setBackgroundImage(); + Utils.setBackgroundImage(""); Popup.back(); Utils.reload(); event.preventDefault();