diff --git a/resources/js/components/gallery/PhotoThumbPanel.vue b/resources/js/components/gallery/PhotoThumbPanel.vue
index 9739d22fa7b..5b14eeb1ef6 100644
--- a/resources/js/components/gallery/PhotoThumbPanel.vue
+++ b/resources/js/components/gallery/PhotoThumbPanel.vue
@@ -34,6 +34,24 @@
+
+
+
+
{{ photoTimeline.header }}
+
+
+
+
diff --git a/resources/js/components/gallery/PhotoThumbPanelList.vue b/resources/js/components/gallery/PhotoThumbPanelList.vue
index 00321c4f383..1204913637c 100644
--- a/resources/js/components/gallery/PhotoThumbPanelList.vue
+++ b/resources/js/components/gallery/PhotoThumbPanelList.vue
@@ -13,9 +13,11 @@
diff --git a/resources/js/layouts/PhotoLayout.ts b/resources/js/layouts/PhotoLayout.ts
index 756103a6ccd..2e4e9603c18 100644
--- a/resources/js/layouts/PhotoLayout.ts
+++ b/resources/js/layouts/PhotoLayout.ts
@@ -5,10 +5,15 @@ import { useMasonry } from "./useMasonry";
import { useGrid } from "./useGrid";
import AlbumService from "@/services/album-service";
+export type TimelineData = {
+ isTimeline: Ref;
+ isLeftBorderVisible: Ref;
+};
+
export function useLayouts(
config: App.Http.Resources.GalleryConfigs.PhotoLayoutConfig,
layout: Ref,
- isTimeline: Ref,
+ timelineData: TimelineData,
elemId: string = "photoListing",
) {
const configRef = ref(config);
@@ -25,7 +30,7 @@ export function useLayouts(
return useSquare(photoListing, configRef.value.photo_layout_square_column_width, configRef.value.photo_layout_gap);
case "justified":
case "unjustified":
- return useJustify(photoListing, configRef.value.photo_layout_justified_row_height, isTimeline.value);
+ return useJustify(photoListing, configRef.value.photo_layout_justified_row_height, timelineData);
case "masonry":
return useMasonry(photoListing, configRef.value.photo_layout_masonry_column_width, configRef.value.photo_layout_gap);
case "grid":
diff --git a/resources/js/layouts/useJustify.ts b/resources/js/layouts/useJustify.ts
index e59e6a13374..8f1ebb006c1 100644
--- a/resources/js/layouts/useJustify.ts
+++ b/resources/js/layouts/useJustify.ts
@@ -1,13 +1,16 @@
+import { TimelineData } from "./PhotoLayout";
import { ChildNodeWithDataStyle } from "./types";
import createJustifiedLayout from "justified-layout";
-export function useJustify(el: HTMLElement, photoDefaultHeight: number = 320, isTimeline: boolean) {
+export function useJustify(el: HTMLElement, photoDefaultHeight: number = 320, timelineData: TimelineData) {
const baseElem = document.getElementById("lychee_view_content");
if (!baseElem) {
return;
}
- const containerDefaultWidth = parseInt(getComputedStyle(baseElem).width) - 86;
- const containerWidth = isTimeline ? Math.min(parseInt(getComputedStyle(el).width), containerDefaultWidth) : parseInt(getComputedStyle(el).width);
+ const containerDefaultWidth = parseInt(getComputedStyle(baseElem).width) - 36 - (timelineData.isLeftBorderVisible ? 50 : 0);
+ const containerWidth = timelineData.isTimeline
+ ? Math.min(parseInt(getComputedStyle(el).width), containerDefaultWidth)
+ : parseInt(getComputedStyle(el).width);
// @ts-expect-error
const justifiedItems: ChildNodeWithDataStyle[] = [...el.childNodes].filter((gridItem) => gridItem.nodeType === 1);