Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

+ bg click hide

Manav Rathi021b6ec9b4f5
diff --git a/web/apps/photos/src/pages/_app.tsx b/web/apps/photos/src/pages/_app.tsx
index f2345ebdfe..e9452c163d 100644
--- a/web/apps/photos/src/pages/_app.tsx
+++ b/web/apps/photos/src/pages/_app.tsx
@@ -55,9 +55,9 @@ import { useCallback, useEffect, useMemo, useState } from "react";
import { resumeExportsIfNeeded } from "services/export";
import { photosLogout } from "services/logout";
-import "photoswipe/dist/photoswipe.css";
+// import "photoswipe/dist/photoswipe.css";
// TODO(PS): Note, auto hide only works with the new CSS.
-// import "../../../../packages/new/photos/components/ps5/dist/photoswipe.css";
+import "../../../../packages/new/photos/components/ps5/dist/photoswipe.css";
import "styles/global.css";
diff --git a/web/packages/new/photos/components/FileViewerPhotoSwipe.ts b/web/packages/new/photos/components/FileViewerPhotoSwipe.ts
index d2ae35b793..0956f7d9cb 100644
--- a/web/packages/new/photos/components/FileViewerPhotoSwipe.ts
+++ b/web/packages/new/photos/components/FileViewerPhotoSwipe.ts
@@ -157,15 +157,17 @@ export class FileViewerPhotoSwipe {
// just the thumbnail has been loaded), this causes PhotoSwipe to
// close. Disable this behaviour.
clickToCloseNonZoomable: false,
- // The default bgClickAction is "close", but it is not always
+ // The default `bgClickAction` is "close", but it is not always
// apparent where the background is and where the controls are,
// since everything is black, and so accidentally closing PhotoSwipe
- // is easy. Disable this behaviour, instead
- // accidental closes
- // are irritatingly easy.
- bgClickAction: () => {
- /* no-op */
- },
+ // is easy.
+ //
+ // Disable this behaviour, instead repurposing this action to behave
+ // the same as the `tapAction` ("tap on PhotoSwipe viewport
+ // content") and toggle the visibility of UI controls (We also have
+ // auto hide based on mouse activity, but that would not have any
+ // effect on touch devices)
+ bgClickAction: "toggle-controls",
// At least on macOS, manual zooming with the trackpad is very
// cumbersome (possibly because of the small multiplier in the
// PhotoSwipe source, but I'm not sure). The other option to do a
@@ -232,6 +234,11 @@ export class FileViewerPhotoSwipe {
return originalResult;
});
+ // TODO(PS): Fix interaction between click hide and auto hide.
+ // pswp.on("bgClickAction", () => {
+ // this.lastActivityDate == "hidden";
+ // });
+
pswp.on("contentLoad", (e) => {
console.log("contentLoad", e);
if (e.content.data.videoURL) {