diff --git a/static/index.html b/static/index.html
index 3ae8265..938dc73 100644
--- a/static/index.html
+++ b/static/index.html
@@ -506,8 +506,10 @@ function loadPreviousPhotos() {
div.innerHTML = data.photos.map(p => renderPrevCard(p)).join('');
// Init maps and asset lookups after rendering
data.photos.forEach(p => {
- if (p.gps_lat && p.gps_lng && p.machine_id) {
+ if (p.gps_lat && p.gps_lng) {
initPrevMap(p);
+ }
+ if (p.machine_id) {
lookupPrevAsset(p);
}
});
@@ -608,13 +610,11 @@ function renderPrevCard(p) {
- ${hasCoords && p.machine_id ? `
` : hasCoords ? `
-
+ ${hasCoords ? `
` : ''}
+
+
`;
}
@@ -675,9 +675,21 @@ function saveMachineIdInline(input, photoId, cancel) {
badge.className = 'match-badge matched';
}
}
- // Update asset info
- const assetEl = document.getElementById('prevAsset' + photoId);
- const infoEl = document.getElementById('prevMachineInfo' + photoId);
+ // Update asset info — create elements if they don't exist yet
+ let assetEl = document.getElementById('prevAsset' + photoId);
+ let infoEl = document.getElementById('prevMachineInfo' + photoId);
+ if (!assetEl && card) {
+ assetEl = document.createElement('div');
+ assetEl.id = 'prevAsset' + photoId;
+ assetEl.style.cssText = 'font-size:11px;margin-top:4px;color:var(--text2);';
+ card.appendChild(assetEl);
+ }
+ if (!infoEl && card) {
+ infoEl = document.createElement('div');
+ infoEl.id = 'prevMachineInfo' + photoId;
+ infoEl.style.cssText = 'margin-top:2px;';
+ card.appendChild(infoEl);
+ }
if (data.asset) {
const a = data.asset;
if (assetEl) {