mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 23:40:13 +01:00
Set card attachment as background image. Part 2.
Thanks to xet7 ! Related #486
This commit is contained in:
parent
e892a6104a
commit
ed92db87bc
4 changed files with 49 additions and 7 deletions
|
|
@ -175,6 +175,10 @@ BlazeComponent.extendComponent({
|
|||
const ret = Cards.findOne(this.data().meta.cardId).coverId == this.data()._id;
|
||||
return ret;
|
||||
},
|
||||
isBackgroundImage() {
|
||||
const currentBoard = Boards.findOne(Session.get('currentBoard'));
|
||||
return currentBoard.backgroundImageURL === $(".attachment-thumbnail-img").attr("src");
|
||||
},
|
||||
events() {
|
||||
return [
|
||||
{
|
||||
|
|
@ -191,6 +195,20 @@ BlazeComponent.extendComponent({
|
|||
Cards.findOne(this.data().meta.cardId).unsetCover();
|
||||
Popup.back();
|
||||
},
|
||||
'click .js-add-background-image'() {
|
||||
const currentBoard = Boards.findOne(Session.get('currentBoard'));
|
||||
currentBoard.setBackgroundImageURL($(".attachment-thumbnail-img").attr("src"));
|
||||
Utils.setBackgroundImage();
|
||||
Popup.back();
|
||||
event.preventDefault();
|
||||
},
|
||||
'click .js-remove-background-image'() {
|
||||
const currentBoard = Boards.findOne(Session.get('currentBoard'));
|
||||
currentBoard.setBackgroundImageURL("");
|
||||
Utils.setBackgroundImage();
|
||||
Popup.back();
|
||||
Utils.reload();
|
||||
},
|
||||
'click .js-move-storage-fs'() {
|
||||
Meteor.call('moveAttachmentToStorage', this.data()._id, "fs");
|
||||
Popup.back();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue