mirror of
https://github.com/open-webui/open-webui
synced 2025-05-01 19:44:38 +00:00
refac
This commit is contained in:
parent
8aa6dade41
commit
22f6e0f2f4
@ -304,18 +304,15 @@
|
|||||||
console.log('Edit');
|
console.log('Edit');
|
||||||
await tick();
|
await tick();
|
||||||
name = folders[folderId].name;
|
name = folders[folderId].name;
|
||||||
edit = true;
|
|
||||||
|
|
||||||
|
edit = true;
|
||||||
await tick();
|
await tick();
|
||||||
|
|
||||||
// focus on the input and select all text
|
const input = document.getElementById(`folder-${folderId}-input`);
|
||||||
setTimeout(() => {
|
|
||||||
const input = document.getElementById(`folder-${folderId}-input`);
|
if (input) {
|
||||||
if (input) {
|
input.focus();
|
||||||
input.focus();
|
}
|
||||||
input.select();
|
|
||||||
}
|
|
||||||
}, 100);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const exportHandler = async () => {
|
const exportHandler = async () => {
|
||||||
@ -404,6 +401,9 @@
|
|||||||
id="folder-{folderId}-input"
|
id="folder-{folderId}-input"
|
||||||
type="text"
|
type="text"
|
||||||
bind:value={name}
|
bind:value={name}
|
||||||
|
on:focus={(e) => {
|
||||||
|
e.target.select();
|
||||||
|
}}
|
||||||
on:blur={() => {
|
on:blur={() => {
|
||||||
nameUpdateHandler();
|
nameUpdateHandler();
|
||||||
edit = false;
|
edit = false;
|
||||||
@ -437,7 +437,10 @@
|
|||||||
>
|
>
|
||||||
<FolderMenu
|
<FolderMenu
|
||||||
on:rename={() => {
|
on:rename={() => {
|
||||||
editHandler();
|
// Requires a timeout to prevent the click event from closing the dropdown
|
||||||
|
setTimeout(() => {
|
||||||
|
editHandler();
|
||||||
|
}, 200);
|
||||||
}}
|
}}
|
||||||
on:delete={() => {
|
on:delete={() => {
|
||||||
showDeleteConfirm = true;
|
showDeleteConfirm = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user