Fix template region stacking order
Publish Docker Image / build-and-push-existing-registry (./build/Dockerfile, web, pulse-signage-web) (push) Successful in 1m19s
Publish Docker Image / build-and-push-existing-registry (./build/Dockerfile.player, player, pulse-signage-player) (push) Successful in 32s

This commit is contained in:
lzstealth committed 2026-10-17 21:20:04 +01:00
1 parent a5d73e75d3
commit 5c134ef75f
7 files changed
+49 -9

No files matched your search

+7 -2
View File
@@ -6,6 +6,11 @@ const animationPresets = require('#src/web/public/js/templates/animation-presets
const TEMPLATE_NAME_MAX_LENGTH = 255;
const REGION_NAME_MAX_LENGTH = 255;
function normalizeRegionZIndex(value) {
const parsed = Number(value);
return Number.isFinite(parsed) ? Math.max(1, Math.round(parsed)) : 1;
}
function sanitizeBackgroundColor(value) {
const raw = String(value || '').trim();
if (/^#[0-9a-fA-F]{6}$/.test(raw) || /^#[0-9a-fA-F]{3}$/.test(raw)) {
@@ -185,7 +190,7 @@ function extractTemplateRegions(body) {
y: Number(region.y || 0),
width: Number(region.width || 100),
height: Number(region.height || 100),
z_index: Number(region.z_index || 0)
z_index: normalizeRegionZIndex(region.z_index)
};
}).filter((region) => region.region_key && region.label);
}
@@ -221,7 +226,7 @@ function extractTemplateRegions(body) {
y: Number(ys[i] || 0),
width: Number(widths[i] || 100),
height: Number(heights[i] || 100),
z_index: Number(zs[i] || 0)
z_index: normalizeRegionZIndex(zs[i])
});
}