diff --git a/src/components/card/AttachmentList.vue b/src/components/card/AttachmentList.vue
index d7c972722..57999fd8f 100644
--- a/src/components/card/AttachmentList.vue
+++ b/src/components/card/AttachmentList.vue
@@ -37,11 +37,20 @@
{{ attachment.createdBy }}
-
-
+
+
{{ t('deck', 'Add this attachment') }}
+
+
+ {{ t('deck', 'Delete Attachment') }}
+
+
+
+ {{ t('deck', 'Restore Attachment') }}
+
+
@@ -64,6 +73,18 @@ export default {
type: Number,
required: true,
},
+ editor: {
+ type: Object,
+ required: false,
+ },
+ selectable: {
+ type: Boolean,
+ required: false,
+ },
+ removable: {
+ type: Boolean,
+ required: false,
+ },
},
data() {
return {
@@ -94,7 +115,22 @@ export default {
},
methods: {
-
+ addAttachment(attachment) {
+ const descString = this.editor.easymde.value()
+ let embed = ''
+ if (attachment.extendedData.mimetype.includes('image')) {
+ embed = '!'
+ }
+ const attachmentString = embed + '[📎 ' + attachment.data + '](' + this.attachmentUrl(attachment) + ')'
+ this.editor.easymde.value(descString + '\n' + attachmentString)
+ this.modalShow = false
+ },
+ deleteAttachment(attachment) {
+ this.$store.dispatch('deleteAttachment', attachment)
+ },
+ restoreAttachment(attachment) {
+ this.$store.dispatch('restoreAttachment', attachment)
+ },
},
}
diff --git a/src/components/card/CardSidebar.vue b/src/components/card/CardSidebar.vue
index eef4cef20..6e4174cac 100644
--- a/src/components/card/CardSidebar.vue
+++ b/src/components/card/CardSidebar.vue
@@ -183,7 +183,11 @@
{{ t('deck', 'Cancel') }}
-->
-
+
@@ -372,6 +376,7 @@ export default {
this.modalShow = true
},
addAttachment(attachment) {
+ console.log('hier')
const descString = this.$refs.markdownEditor.easymde.value()
let embed = ''
if (attachment.extendedData.mimetype.includes('image')) {
@@ -606,88 +611,4 @@ export default {
margin: 40px 3px 3px 0;
}
- .attachment-list {
- &.selector {
- padding: 10px;
- position: absolute;
- width: 30%;
- max-width: 500px;
- min-width: 200px;
- max-height: 50%;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%);
- background-color: #eee;
- z-index: 2;
- border-radius: 3px;
- box-shadow: 0 0 3px darkgray;
- overflow: scroll;
- }
- h3.attachment-selector {
- margin: 0 0 10px;
- padding: 0;
- .icon-close {
- display: inline-block;
- float: right;
- }
- }
-
- li.attachment {
- display: flex;
- padding: 3px;
- min-height: 44px;
-
- &.deleted {
- opacity: .5;
- }
-
- .fileicon {
- display: inline-block;
- min-width: 32px;
- width: 32px;
- height: 32px;
- background-size: contain;
- }
- .details {
- flex-grow: 1;
- flex-shrink: 1;
- min-width: 0;
- flex-basis: 50%;
- line-height: 110%;
- padding: 2px;
- }
- .filename {
- width: 70%;
- display: flex;
- .basename {
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- padding-bottom: 2px;
- }
- .extension {
- opacity: 0.7;
- }
- }
- .filesize, .filedate {
- font-size: 90%;
- color: darkgray;
- }
- .app-popover-menu-utils {
- position: relative;
- right: -10px;
- button {
- height: 32px;
- width: 42px;
- }
- }
- button.icon-history {
- width: 44px;
- }
- progress {
- margin-top: 3px;
- }
- }
- }
-
diff --git a/src/components/card/CardSidebarTabAttachments.vue b/src/components/card/CardSidebarTabAttachments.vue
index c134a8263..5291c59f8 100644
--- a/src/components/card/CardSidebarTabAttachments.vue
+++ b/src/components/card/CardSidebarTabAttachments.vue
@@ -43,53 +43,28 @@
-
-
-
-
-
- {{ t('deck', 'Delete Attachment') }}
-
-
- {{ t('deck', 'Restore Attachment') }}
-
-
-
+
@@ -172,19 +135,6 @@ export default {
background-position: 10px center;
}
- .modal__content {
- width: 25vw;
- min-width: 250px;
- height: 120px;
- text-align: center;
- margin: 20px 20px 60px 20px;
- }
-
- .modal__content button {
- float: right;
- margin: 40px 3px 3px 0;
- }
-
.attachment-list {
&.selector {
padding: 10px;