diff --git a/src/components/AlbumsList.vue b/src/components/AlbumsList.vue index 094744ec..be8b3c34 100644 --- a/src/components/AlbumsList.vue +++ b/src/components/AlbumsList.vue @@ -128,7 +128,7 @@ e.preventDefault(); }, - async addToAlbum() { + addToAlbum() { (this.$refs.addToAlbumModal).open([{ fileid: this.photo.id, basename: this.photo.name, diff --git a/src/components/viewer/Viewer.vue b/src/components/viewer/Viewer.vue index de62d3f2..89f46280 100644 --- a/src/components/viewer/Viewer.vue +++ b/src/components/viewer/Viewer.vue @@ -136,6 +136,17 @@ + + {{ t('memories', 'Add to album') }} + + @@ -151,6 +162,7 @@ + @@ -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) { + (this.$refs.addToAlbumModal).open([this.currentPhoto]); + } + }, }, });