mirror of
https://codeberg.org/PLG-Development/PLG-MuDiCS
synced 2026-07-06 00:47:09 +00:00
fix(control): close popups immediately after submitting -> ui feels faster and second input is not longer possible
This commit is contained in:
@@ -51,6 +51,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function finalize_add_edit_display(existing_display_id: string | null) {
|
async function finalize_add_edit_display(existing_display_id: string | null) {
|
||||||
|
popup_close_function();
|
||||||
const ip = text_inputs_valid.ip.value;
|
const ip = text_inputs_valid.ip.value;
|
||||||
const mac = text_inputs_valid.mac.value === '' ? null : text_inputs_valid.mac.value;
|
const mac = text_inputs_valid.mac.value === '' ? null : text_inputs_valid.mac.value;
|
||||||
const name = text_inputs_valid.name.value;
|
const name = text_inputs_valid.name.value;
|
||||||
@@ -60,7 +61,6 @@
|
|||||||
const status = await ping_ip(text_inputs_valid.ip.value);
|
const status = await ping_ip(text_inputs_valid.ip.value);
|
||||||
await add_display(ip, mac, name, status);
|
await add_display(ip, mac, name, status);
|
||||||
}
|
}
|
||||||
popup_close_function();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function popup_close_function() {
|
function popup_close_function() {
|
||||||
@@ -127,8 +127,8 @@
|
|||||||
active_bg="bg-red-500"
|
active_bg="bg-red-500"
|
||||||
className="px-4 flex text-red-400 hover:text-stone-100"
|
className="px-4 flex text-red-400 hover:text-stone-100"
|
||||||
click_function={async () => {
|
click_function={async () => {
|
||||||
await remove_display(display_id);
|
|
||||||
popup_close_function();
|
popup_close_function();
|
||||||
|
await remove_display(display_id);
|
||||||
}}>Löschen</Button
|
}}>Löschen</Button
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -72,16 +72,17 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function create_new_folder() {
|
async function create_new_folder() {
|
||||||
|
popup_close_function();
|
||||||
await create_folder_on_all_selected_displays(
|
await create_folder_on_all_selected_displays(
|
||||||
current_name.trim(),
|
current_name.trim(),
|
||||||
$current_file_path,
|
$current_file_path,
|
||||||
$selected_display_ids
|
$selected_display_ids
|
||||||
);
|
);
|
||||||
await update_current_folder_on_selected_displays();
|
await update_current_folder_on_selected_displays();
|
||||||
popup_close_function();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function edit_file_name(new_file_name: string) {
|
async function edit_file_name(new_file_name: string) {
|
||||||
|
popup_close_function();
|
||||||
await run_for_selected_files_on_selected_displays(async (ip: string, file_names: string[]) => {
|
await run_for_selected_files_on_selected_displays(async (ip: string, file_names: string[]) => {
|
||||||
if (file_names.length !== 1) {
|
if (file_names.length !== 1) {
|
||||||
console.log('EEEERRRRROOOOOOR', file_names);
|
console.log('EEEERRRRROOOOOOR', file_names);
|
||||||
@@ -90,7 +91,6 @@
|
|||||||
await rename_file(ip, $current_file_path, file_names[0], new_file_name);
|
await rename_file(ip, $current_file_path, file_names[0], new_file_name);
|
||||||
});
|
});
|
||||||
await update_current_folder_on_selected_displays();
|
await update_current_folder_on_selected_displays();
|
||||||
popup_close_function();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const show_edit_file_popup = async () => {
|
const show_edit_file_popup = async () => {
|
||||||
@@ -229,13 +229,13 @@
|
|||||||
active_bg="bg-red-500"
|
active_bg="bg-red-500"
|
||||||
className="px-4 flex text-red-400 hover:text-stone-100"
|
className="px-4 flex text-red-400 hover:text-stone-100"
|
||||||
click_function={async () => {
|
click_function={async () => {
|
||||||
|
popup_close_function();
|
||||||
await run_for_selected_files_on_selected_displays(
|
await run_for_selected_files_on_selected_displays(
|
||||||
async (ip: string, file_names: string[]) => {
|
async (ip: string, file_names: string[]) => {
|
||||||
await delete_files(ip, $current_file_path, file_names);
|
await delete_files(ip, $current_file_path, file_names);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
await update_current_folder_on_selected_displays();
|
await update_current_folder_on_selected_displays();
|
||||||
popup_close_function();
|
|
||||||
}}>Löschen</Button
|
}}>Löschen</Button
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user