mirror of
https://github.com/open-webui/open-webui
synced 2025-01-19 09:16:44 +00:00
refac
This commit is contained in:
parent
5065291f72
commit
984e0c533e
@ -73,6 +73,7 @@
|
|||||||
</div>
|
</div>
|
||||||
{:else if $showControls}
|
{:else if $showControls}
|
||||||
<Drawer
|
<Drawer
|
||||||
|
show={$showControls}
|
||||||
on:close={() => {
|
on:close={() => {
|
||||||
showControls.set(false);
|
showControls.set(false);
|
||||||
}}
|
}}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<script>
|
<script lang="ts">
|
||||||
import { getContext, createEventDispatcher } from 'svelte';
|
import { getContext, createEventDispatcher } from 'svelte';
|
||||||
import { useSvelteFlow, useNodesInitialized, useStore } from '@xyflow/svelte';
|
import { useSvelteFlow, useNodesInitialized, useStore } from '@xyflow/svelte';
|
||||||
import { SvelteFlow, Controls, Background, BackgroundVariant } from '@xyflow/svelte';
|
import { SvelteFlow, Controls, Background, BackgroundVariant } from '@xyflow/svelte';
|
||||||
@ -91,6 +91,8 @@
|
|||||||
id: parentId + '-' + pos.id,
|
id: parentId + '-' + pos.id,
|
||||||
source: parentId,
|
source: parentId,
|
||||||
target: pos.id,
|
target: pos.id,
|
||||||
|
selectable: false,
|
||||||
|
|
||||||
type: 'smoothstep',
|
type: 'smoothstep',
|
||||||
animated: true
|
animated: true
|
||||||
});
|
});
|
||||||
|
@ -44,19 +44,22 @@
|
|||||||
window.addEventListener('keydown', handleKeyDown);
|
window.addEventListener('keydown', handleKeyDown);
|
||||||
document.body.style.overflow = 'hidden';
|
document.body.style.overflow = 'hidden';
|
||||||
} else if (modalElement) {
|
} else if (modalElement) {
|
||||||
window.removeEventListener('keydown', handleKeyDown);
|
|
||||||
document.body.removeChild(modalElement);
|
|
||||||
document.body.style.overflow = 'unset';
|
|
||||||
}
|
|
||||||
|
|
||||||
$: if (!show) {
|
|
||||||
dispatch('close');
|
dispatch('close');
|
||||||
|
window.removeEventListener('keydown', handleKeyDown);
|
||||||
|
|
||||||
|
if (document.body.contains(modalElement)) {
|
||||||
|
document.body.removeChild(modalElement);
|
||||||
|
document.body.style.overflow = 'unset';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onDestroy(() => {
|
onDestroy(() => {
|
||||||
show = false;
|
show = false;
|
||||||
if (modalElement) {
|
if (modalElement) {
|
||||||
document.body.removeChild(modalElement);
|
if (document.body.contains(modalElement)) {
|
||||||
|
document.body.removeChild(modalElement);
|
||||||
|
document.body.style.overflow = 'unset';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
Reference in New Issue
Block a user