From 0507eb6550830f7b76910d51200675de0aa9b1de Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Sun, 15 Aug 2021 21:04:49 +0300 Subject: [PATCH] ability to move attachments around when making a new post --- src/components/attachment/attachment.js | 8 +++++++ src/components/attachment/attachment.vue | 24 +++++++++++++++++-- src/components/gallery/gallery.js | 2 ++ src/components/gallery/gallery.vue | 10 ++++---- .../post_status_form/post_status_form.js | 13 +++++++++- .../post_status_form/post_status_form.vue | 2 ++ src/i18n/en.json | 7 ++++++ 7 files changed, 59 insertions(+), 7 deletions(-) diff --git a/src/components/attachment/attachment.js b/src/components/attachment/attachment.js index fea7c6f8..f9c8d981 100644 --- a/src/components/attachment/attachment.js +++ b/src/components/attachment/attachment.js @@ -42,6 +42,8 @@ const Attachment = { 'size', 'setMedia', 'remove', + 'shiftUp', + 'shiftDn', 'edit' ], data () { @@ -154,6 +156,12 @@ const Attachment = { onRemove () { this.remove && this.remove(this.attachment) }, + onShiftUp () { + this.shiftUp && this.shiftUp(this.attachment) + }, + onShiftDn () { + this.shiftDn && this.shiftDn(this.attachment) + }, stopFlash () { this.$refs.flash.closePlayer() }, diff --git a/src/components/attachment/attachment.vue b/src/components/attachment/attachment.vue index 82a72a8d..4abf63dd 100644 --- a/src/components/attachment/attachment.vue +++ b/src/components/attachment/attachment.vue @@ -30,7 +30,7 @@
@@ -83,6 +83,7 @@ v-if="type === 'flash' && flashLoaded" class="button-unstyled attachment-button" @click.prevent="stopFlash" + :title="$t('status.attachment_stop_flash')" > @@ -98,6 +99,7 @@ v-if="!useModal" class="button-unstyled attachment-button" @click.prevent="openModalForce" + :title="$t('status.show_attachment_in_modal')" > @@ -105,13 +107,31 @@ v-if="nsfw && hideNsfwLocal" class="button-unstyled attachment-button" @click.prevent="toggleHidden" + :title="$t('status.hide_attachment')" > + + @@ -209,7 +229,7 @@
diff --git a/src/components/gallery/gallery.js b/src/components/gallery/gallery.js index 15436d61..094b3e57 100644 --- a/src/components/gallery/gallery.js +++ b/src/components/gallery/gallery.js @@ -12,6 +12,8 @@ const Gallery = { 'size', 'editable', 'removeAttachment', + 'shiftUpAttachment', + 'shiftDnAttachment', 'editAttachment', 'grid' ], diff --git a/src/components/gallery/gallery.vue b/src/components/gallery/gallery.vue index 18b94d58..f9cad8a9 100644 --- a/src/components/gallery/gallery.vue +++ b/src/components/gallery/gallery.vue @@ -6,8 +6,8 @@ >