π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Fix toggle
Manav Rathi215ed6d6c83f
diff --git a/web/packages/gallery/components/viewer/photoswipe.ts b/web/packages/gallery/components/viewer/photoswipe.tsindex 5510456b0a..c2999cbe11 100644--- a/web/packages/gallery/components/viewer/photoswipe.ts+++ b/web/packages/gallery/components/viewer/photoswipe.ts@@ -407,6 +407,11 @@ export class FileViewerPhotoSwipe {onClose();});+ const showIf = (element: HTMLElement, condition: boolean) =>+ condition+ ? element.classList.remove("pswp--ui-visible")+ : element.classList.add("pswp--ui-visible");+// Add our custom UI elements to inside the PhotoSwipe dialog.//// API docs for registerElement:@@ -445,14 +450,13 @@ export class FileViewerPhotoSwipe {isButton: true,html: createPSRegisterElementIconHTML("favorite"),onClick: withCurrentAnnotatedFile(onToggleFavorite),- onInit: (buttonElement, pswp) => {+ onInit: (buttonElement) =>pswp.on("change", () =>- buttonElement.classList.toggle(- "pswp--ui-visible",+ showIf(+ buttonElement,currentFileAnnotation().isFavorite === false,),- );- },+ ),});pswp.ui.registerElement({name: "unfavorite",@@ -461,14 +465,13 @@ export class FileViewerPhotoSwipe {isButton: true,html: createPSRegisterElementIconHTML("unfavorite"),onClick: withCurrentAnnotatedFile(onToggleFavorite),- onInit: (buttonElement, pswp) => {+ onInit: (buttonElement) =>pswp.on("change", () =>- buttonElement.classList.toggle(- "pswp--ui-visible",+ showIf(+ buttonElement,currentFileAnnotation().isFavorite === true,),- );- },+ ),});}@@ -491,14 +494,13 @@ export class FileViewerPhotoSwipe {isButton: true,html: createPSRegisterElementIconHTML("edit"),onClick: withCurrentAnnotatedFile(onEditImage),- onInit: (buttonElement, pswp) => {+ onInit: (buttonElement) =>pswp.on("change", () =>- buttonElement.classList.toggle(- "pswp--ui-visible",+ showIf(+ buttonElement,!!currentFileAnnotation().isEditableImage,),- );- },+ ),});}});