all: fix modal calls

pull/461/head
Varun Patil 2023-03-07 18:56:23 -08:00
parent f2285a6fa5
commit ecc4bd0b34
5 changed files with 19 additions and 17 deletions

View File

@ -4,6 +4,8 @@ This file is manually updated. Please file an issue if something is missing.
## v4.12.0, v3.12.0
- **Feature**: Allow bulk editing of EXIF attributes other than date/time
- **Feature**: Show list of tags in sidebar
- **Feature**: Configurable album sorting order ([#377](https://github.com/pulsejet/memories/issues/377))
- **Feature**: Allow archiving photos throw folder view ([#350](https://github.com/pulsejet/memories/issues/350))
- **Feature**: Add search bar to face cluster merge dialog ([#177](https://github.com/pulsejet/memories/issues/177))

View File

@ -114,7 +114,7 @@ export default defineComponent({
title: this.dateOriginalStr,
subtitle: this.dateOriginalTime,
icon: CalendarIcon,
edit: () => globalThis.editDate(globalThis.currentViewerPhoto),
edit: () => globalThis.editMetadata([globalThis.currentViewerPhoto]),
});
}
@ -141,7 +141,15 @@ export default defineComponent({
title: title || this.t("memories", "No title"),
subtitle: [desc || this.t("memories", "No description")],
icon: InfoIcon,
edit: () => globalThis.editExif(globalThis.currentViewerPhoto),
edit: () => globalThis.editMetadata([globalThis.currentViewerPhoto]),
});
}
if (this.tagNamesStr) {
list.push({
title: this.tagNamesStr,
subtitle: [],
icon: TagIcon,
});
}
@ -154,14 +162,6 @@ export default defineComponent({
});
}
if (this.tagNamesStr) {
list.push({
title: this.tagNamesStr,
subtitle: [],
icon: TagIcon,
});
}
return list;
},

View File

@ -209,13 +209,13 @@ export default defineComponent({
];
// Ugly: globally exposed functions
const getSel = (photo: IPhoto) => {
globalThis.editMetadata = (photos: IPhoto[]) => {
const sel = new Map<number, IPhoto>();
sel.set(photo.fileid, photo);
return sel;
for (const photo of photos) {
sel.set(photo.fileid, photo);
}
this.editMetadataSelection(sel);
};
globalThis.editMetadata = (photo: IPhoto) =>
this.editMetadataSelection(getSel(photo));
},
watch: {

View File

@ -1168,7 +1168,7 @@ export default defineComponent({
* Edit Metadata for current photo
*/
editMetadata() {
globalThis.editMetadata(globalThis.currentViewerPhoto);
globalThis.editMetadata([globalThis.currentViewerPhoto]);
},
},
});

View File

@ -22,7 +22,7 @@ declare global {
var OC: Nextcloud.v24.OC;
var OCP: Nextcloud.v24.OCP;
var editDate: (photo: IPhoto) => void;
var editMetadata: (photos: IPhoto[]) => void;
var currentViewerPhoto: IPhoto;
var windowInnerWidth: number; // cache