Compare commits
3 Commits
d35a28f912
...
ad3b27b747
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ad3b27b747 | ||
|
|
15566efec1 | ||
|
|
5e07f2822c |
@@ -731,6 +731,34 @@ async function reset_font_sizes_to_auto() {
|
||||
}
|
||||
}
|
||||
|
||||
// --- Auto-save font sizes on change ---
|
||||
// When a trusted user adjusts font sizes the change is saved automatically after a
|
||||
// short debounce so they don't have to find and click "Lock Sizes" every time.
|
||||
// WHY: the Lock Sizes button is in the Staff section (starts collapsed) and users
|
||||
// routinely adjusted font sizes and then reloaded, losing their changes.
|
||||
// reset_font_sizes_to_auto handles its own save, so we only auto-save when at
|
||||
// least one size is non-null (i.e. the "reset to auto" path is excluded here).
|
||||
let _font_auto_save_timer: ReturnType<typeof setTimeout> | null = null;
|
||||
$effect(() => {
|
||||
// Re-read the dirty+override signals inside the effect so Svelte tracks them.
|
||||
const dirty = sizes_are_dirty;
|
||||
const has_override = has_any_size_override;
|
||||
if (!dirty || !has_override || !is_trusted || !$lq__event_badge_obj?.event_badge_id) {
|
||||
return;
|
||||
}
|
||||
if (_font_auto_save_timer !== null) clearTimeout(_font_auto_save_timer);
|
||||
_font_auto_save_timer = setTimeout(() => {
|
||||
_font_auto_save_timer = null;
|
||||
lock_font_sizes();
|
||||
}, 600);
|
||||
return () => {
|
||||
if (_font_auto_save_timer !== null) {
|
||||
clearTimeout(_font_auto_save_timer);
|
||||
_font_auto_save_timer = null;
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
// TC modal ref for the lead scanning terms & conditions dialog
|
||||
let tc_dialog_ref: HTMLDialogElement | undefined;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user