From 83a23eb75dddb7d4a87fc0d5b2d5d5aa82c17f19 Mon Sep 17 00:00:00 2001 From: Enrico Date: Mon, 19 Jan 2026 22:34:30 +0100 Subject: [PATCH] fix manual changes --- js/ltxv_timeline_editor.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/js/ltxv_timeline_editor.js b/js/ltxv_timeline_editor.js index 1b31b84..2fa7ee5 100644 --- a/js/ltxv_timeline_editor.js +++ b/js/ltxv_timeline_editor.js @@ -140,14 +140,27 @@ class LTXVTimelineEditor { this.pixelsPerSec = 30; // Zoom level this.selection = { sceneId: null, frameId: null }; this.currentUploadTarget = null; + this.lastParsedValue = null; // Track last synced value // Parse Widget Value - this.parseScript(widget.value); + this.syncFromWidget(); // Build UI this.buildUI(); } + // Sync timeline state from widget value (called on open) + syncFromWidget() { + const currentValue = this.widget.value; + // Only re-parse if value actually changed + if (currentValue !== this.lastParsedValue) { + this.parseScript(currentValue); + this.lastParsedValue = currentValue; + return true; // Changed + } + return false; // No change + } + // --- PARSING & SERIALIZATION --- parseScript(script) { @@ -351,6 +364,8 @@ class LTXVTimelineEditor { // --- ACTIONS --- open() { + // Sync from widget in case it was edited externally + this.syncFromWidget(); this.overlay.style.display = "flex"; this.render(); }