Adds additional button to menu

Signed-off-by: Alexander Saltykov <temp.kroogi@gmail.com>
pull/752/head
Alexander Saltykov 2023-07-28 08:59:19 +03:00
parent cb78e654b0
commit 67da46f6dd
2 changed files with 23 additions and 1 deletions

View File

@ -128,7 +128,7 @@
e.preventDefault();
},
async addToAlbum() {
addToAlbum() {
(<any>this.$refs.addToAlbumModal).open([{
fileid: this.photo.id,
basename: this.photo.name,

View File

@ -136,6 +136,17 @@
<EditFileIcon :size="24" />
</template>
</NcActionButton>
<NcActionButton
:aria-label="t('memories', 'Add to album')"
v-if="canEdit"
@click="addToAlbum"
:close-after-click="true"
>
{{ t('memories', 'Add to album') }}
<template #icon>
<AlbumIcon :size="24" />
</template>
</NcActionButton>
</NcActions>
</div>
@ -151,6 +162,7 @@
</div>
</div>
</div>
<AddToAlbumModal ref="addToAlbumModal" />
</div>
</template>
@ -179,6 +191,7 @@ import 'photoswipe/style.css';
import PsImage from './PsImage';
import PsVideo from './PsVideo';
import PsLivePhoto from './PsLivePhoto';
import AddToAlbumModal from '../modal/AddToAlbumModal.vue';
import ShareIcon from 'vue-material-design-icons/ShareVariant.vue';
import DeleteIcon from 'vue-material-design-icons/TrashCanOutline.vue';
@ -192,6 +205,7 @@ import SlideshowIcon from 'vue-material-design-icons/PlayBox.vue';
import EditFileIcon from 'vue-material-design-icons/FileEdit.vue';
import AlbumRemoveIcon from 'vue-material-design-icons/BookRemove.vue';
import LivePhotoIcon from 'vue-material-design-icons/MotionPlayOutline.vue';
import AlbumIcon from 'vue-material-design-icons/ImageAlbum.vue';
const SLIDESHOW_MS = 5000;
const BODY_HAS_VIEWER = 'has-viewer';
@ -216,6 +230,8 @@ export default defineComponent({
EditFileIcon,
AlbumRemoveIcon,
LivePhotoIcon,
AlbumIcon,
AddToAlbumModal,
},
mixins: [UserConfig],
@ -1123,6 +1139,12 @@ export default defineComponent({
editMetadata() {
globalThis.editMetadata([globalThis.currentViewerPhoto]);
},
addToAlbum() {
if (this.currentPhoto) {
(<any>this.$refs.addToAlbumModal).open([this.currentPhoto]);
}
},
},
});
</script>