From b11636bfdfcbba30abeb5d77a2b66aa57239ee23 Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Fri, 28 Feb 2025 05:59:01 +0530 Subject: [PATCH] zoom left --- web/packages/gallery/components/viewer/photoswipe.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/web/packages/gallery/components/viewer/photoswipe.ts b/web/packages/gallery/components/viewer/photoswipe.ts index adc8fd606a..dee195aba8 100644 --- a/web/packages/gallery/components/viewer/photoswipe.ts +++ b/web/packages/gallery/components/viewer/photoswipe.ts @@ -423,6 +423,17 @@ export class FileViewerPhotoSwipe { // - zoom: 10 // - close: 20 pswp.on("uiRegister", () => { + // Move the zoom button to the left so that it is in the same place + // as the other items like preloader or the error indicator that + // come and go as files get loaded. + // + // We cannot use the PhotoSwipe "uiElement" filter to modify the + // order since that only allows us to edit the DOM element, not the + // underlying UI element data. + pswp.ui.uiElementsData.find((e) => e.name == "zoom").order = 6; + + // Register our custom elements... + pswp.ui.registerElement({ name: "error", order: 6,