From 47e77f9fac1155c536b2b87fec552c7fcce66fa6 Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Mon, 01 Jun 2026 18:06:34 +0000
Subject: [PATCH] =Timeline block fixes. Next up: adding article schema classes

---
 assets/js/concise/View.js |   19 ++++++++++++-------
 1 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/assets/js/concise/View.js b/assets/js/concise/View.js
index 423d8a4..3f71831 100644
--- a/assets/js/concise/View.js
+++ b/assets/js/concise/View.js
@@ -370,7 +370,7 @@
 		}
 
 		if (Object.hasOwn(this.ui.table.table.dataset, 'edit')) {
-			new window.jvbPopulate(row, item.fields, item.images);
+			new window.jvbPopulate(row, item);
 		} else {
 			for (let [key, value] of Object.entries(item)) {
 				let col = row.querySelector(`[data-field="${key}"]`);
@@ -415,24 +415,29 @@
 		let timelinePoint = row.querySelector('.timeline-point');
 		let tbody = row;
 
-		// Populate shared fields - NO prefixing!
+		// Populate shared fields
 		let sharedRow = row.querySelector('tr.shared');
-		new window.jvbPopulate(sharedRow, item.fields, item.images);
+		new window.jvbPopulate(sharedRow, item);
 		this.prefixTimelineFieldNames(sharedRow, item.id);
 		this.cleanupTableRow(sharedRow);
 
-		// Handle timeline points - NO prefixing!
+		// Handle timeline points
 		if (item.fields.timeline && typeof item.fields.timeline === 'object') {
 			const timelineArray = Object.entries(item.fields.timeline);
 
 			timelineArray.forEach(([imgId, timeline], index) => {
-
 				let point = timelinePoint.cloneNode(true);
 				point.dataset.index = index;
 				point.dataset.imageId = imgId;
 
+				// NEW: Create item-like structure for timeline point
+				const timelineItem = {
+					fields: timeline,
+					images: item.images,
+					taxonomies: {} // Timeline points don't have taxonomies
+				};
 
-				new window.jvbPopulate(point, timeline, item.images);
+				new window.jvbPopulate(point, timelineItem);
 
 				this.cleanupTableRow(point);
 				let imgdata = item.images[timeline.post_thumbnail];
@@ -440,7 +445,7 @@
 					point.querySelector('.field.upload').title = imgdata['image-title'];
 				}
 
-				this.prefixTimelineFieldNames(point,timeline.id);
+				this.prefixTimelineFieldNames(point, timeline.id);
 
 				tbody.insertBefore(point, timelinePoint);
 			});

--
Gitblit v1.10.0