cleaning up javascript code

This commit is contained in:
2025-07-29 09:01:37 +02:00
parent 89abbf5c62
commit 90a936b07f
13 changed files with 138 additions and 114 deletions

View File

@@ -4,15 +4,15 @@
let {
editable = false,
onclick = evt => { startEdit() },
onSet = newVal => {return true;},
type = 'div',
value = $bindable(null)
onclick = evt => { startEdit() },
onSet = newVal => {return true;},
type = 'div',
value = $bindable(null)
} = $props();
let editing = $state(false);
let editing = $state(false);
let editValue = value;
let start = 0;
let start = 0;
async function applyEdit(){
let success = await onSet(editValue);
@@ -21,7 +21,7 @@
}
function resetEdit(){
editing = false;
editing = false;
editValue = value;
}
@@ -63,7 +63,6 @@
measured(evt, evt.timeStamp - start);
}
activeField.subscribe((val) => resetEdit());
</script>