fix manual changes

This commit is contained in:
Enrico
2026-01-19 22:34:30 +01:00
parent b376fa064a
commit 83a23eb75d
+16 -1
View File
@@ -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();
}