cleaning up javascript code
This commit is contained in:
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user