fix: correct remaining native 'event.preventDefault()' calls

- Reverted incorrect snake_case 'event.prevent_default()' to native CamelCase 'event.preventDefault()' across multiple components.
- Finalized formatting for event files upload and archive content edit components.
This commit is contained in:
Scott Idem
2026-02-06 15:10:10 -05:00
parent f8476e1133
commit ec363f16fc
4 changed files with 294 additions and 136 deletions

View File

@@ -73,7 +73,7 @@
// *** Functions and Logic
function prevent_default<T extends Event>(fn: (event: T) => void) {
return function (event: T) {
event.prevent_default();
event.preventDefault();
fn(event);
};
}
@@ -94,12 +94,19 @@
// Loop through each file and upload them individually in event.target[input_element_id].files
// The task_id should be the file hash.
// processed_file_list[i] has the file hash_sha256, hash_sha256_match, warnings, uploaded, uploaded_bytes, filename, and file_size_bytes.
for (let i = 0; i < event.target[input_element_id].files.length; i++) {
for (
let i = 0;
i < event.target[input_element_id].files.length;
i++
) {
let tmp_file = event.target[input_element_id].files[i];
task_id = $events_sess.files.processed_file_list[i].hash_sha256;
hosted_file_results = await handle_input_upload_files([tmp_file], task_id);
hosted_file_results = await handle_input_upload_files(
[tmp_file],
task_id
);
if (hosted_file_results) {
console.log(`hosted_file_results:`, hosted_file_results);
@@ -134,7 +141,9 @@
async function handle_input_upload_files(input_upload_files, task_id) {
log_lvl = 0;
if (log_lvl) {
console.log(`*** handle_input_upload_files() *** task_id = ${task_id}`);
console.log(
`*** handle_input_upload_files() *** task_id = ${task_id}`
);
}
const form_data = new FormData();
@@ -251,7 +260,10 @@
</script>
<!-- class:hidden={!$ae_loc.trusted_access} -->
<form onsubmit={prevent_default(handle_submit_form_files)} class="{class_li_default} {class_li}">
<form
onsubmit={prevent_default(handle_submit_form_files)}
class="{class_li_default} {class_li}"
>
{#await ae_promises.upload__hosted_file_obj}
<div class="text-lg flex flex-row gap-1 items-center justify-center">
<span class="fas fa-spinner fa-spin m-1"></span>