From 5387586c7a8b207e2d6ab57ca0408dbf3c0d3ced Mon Sep 17 00:00:00 2001 From: Varun Patil Date: Sat, 5 Nov 2022 17:24:40 -0700 Subject: [PATCH] viewer: DL button --- src/components/Viewer.vue | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/components/Viewer.vue b/src/components/Viewer.vue index bbd1e96f..facb1144 100644 --- a/src/components/Viewer.vue +++ b/src/components/Viewer.vue @@ -2,7 +2,7 @@
- + + + {{ t("memories", "Download") }} + +
@@ -46,6 +56,7 @@ import "photoswipe/style.css"; import DeleteIcon from "vue-material-design-icons/Delete.vue"; import StarIcon from "vue-material-design-icons/Star.vue"; import StarOutlineIcon from "vue-material-design-icons/StarOutline.vue"; +import DownloadIcon from "vue-material-design-icons/Download.vue"; @Component({ components: { @@ -54,6 +65,7 @@ import StarOutlineIcon from "vue-material-design-icons/StarOutline.vue"; DeleteIcon, StarIcon, StarOutlineIcon, + DownloadIcon, }, }) export default class Viewer extends Mixins(GlobalMixin) { @@ -372,6 +384,13 @@ export default class Viewer extends Mixins(GlobalMixin) { photo.flag &= ~this.c.FLAG_IS_FAVORITE; } } + + /** Download the current photo */ + private async downloadCurrent() { + const photo = this.getCurrentPhoto(); + if (!photo) return; + dav.downloadFilesByIds([photo]); + } }