mirror of
https://github.com/open-webui/open-webui.git
synced 2026-08-28 05:27:35 +00:00
refac
This commit is contained in:
parent
fca3be5416
commit
0fb542b376
2 changed files with 3 additions and 3 deletions
|
|
@ -310,7 +310,6 @@
|
|||
open={$showControls}
|
||||
bind:width={controlsWidth}
|
||||
minWidth={350}
|
||||
maxWidth={640}
|
||||
storageKey="chatControlsSize"
|
||||
className="h-full z-10 bg-white dark:bg-gray-900"
|
||||
>
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
export let side: 'left' | 'right' = 'right';
|
||||
export let width = 350;
|
||||
export let minWidth = 300;
|
||||
export let maxWidth = 640;
|
||||
export let maxWidth: number | null = null;
|
||||
export let storageKey = '';
|
||||
export let className = '';
|
||||
export let resizerId = 'controls-resizer';
|
||||
|
|
@ -14,7 +14,8 @@
|
|||
let startClientX = 0;
|
||||
let startWidth = 0;
|
||||
|
||||
const clamp = (value: number) => Math.min(maxWidth, Math.max(minWidth, value));
|
||||
const clamp = (value: number) =>
|
||||
maxWidth === null ? Math.max(minWidth, value) : Math.min(maxWidth, Math.max(minWidth, value));
|
||||
|
||||
const persistWidth = () => {
|
||||
if (storageKey) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue