mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-10-30 08:16:49 +00:00
UX improvements
This commit is contained in:
@@ -77,10 +77,6 @@
|
||||
runPreview($previewArgs)
|
||||
}
|
||||
break
|
||||
|
||||
case 'Escape':
|
||||
dispatch('close')
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,19 +31,33 @@
|
||||
open = !open
|
||||
}
|
||||
|
||||
function onKeyDown(event: KeyboardEvent) {
|
||||
if (open) {
|
||||
switch (event.key) {
|
||||
case 'Escape':
|
||||
open = false
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$: open ? dispatch('open') : dispatch('close')
|
||||
|
||||
let timeout = true
|
||||
$: !open ? setTimeout(() => (timeout = true), duration * 1000) : (timeout = false)
|
||||
onMount(() => {
|
||||
mounted = true
|
||||
scrollLock(open)
|
||||
})
|
||||
</script>
|
||||
|
||||
<aside class="drawer" class:open {style}>
|
||||
<svelte:window on:keydown={onKeyDown} />
|
||||
|
||||
<aside class="drawer" class:open class:close={!open} {style}>
|
||||
<div class="overlay" on:click={handleClickAway} />
|
||||
|
||||
<div class="panel {placement}" class:size>
|
||||
{#if open}
|
||||
{#if open || !timeout}
|
||||
<slot />
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
@@ -47,12 +47,12 @@
|
||||
>
|
||||
<div
|
||||
class={classNames(
|
||||
'fixed inset-0 bg-gray-600 bg-opacity-75 transition-opacity ease-linear duration-300',
|
||||
menuOpen ? 'opacity-100' : 'opacity-0 '
|
||||
'fixed inset-0 bg-gray-600 bg-opacity-75 transition-opacity ease-linear duration-300 z-40',
|
||||
menuOpen ? 'opacity-100' : 'opacity-0'
|
||||
)}
|
||||
/>
|
||||
|
||||
<div class="fixed inset-0 flex">
|
||||
<div class="fixed inset-0 flex z-40">
|
||||
<div
|
||||
class={classNames(
|
||||
'relative flex-1 flex flex-col max-w-xs w-full bg-white transition ease-in-out duration-300 transform',
|
||||
@@ -106,7 +106,7 @@
|
||||
|
||||
<div
|
||||
class={classNames(
|
||||
'hidden md:flex md:flex-col md:fixed md:inset-y-0 transition-all ease-in-out duration-200 shadow-md z-10',
|
||||
'hidden md:flex md:flex-col md:fixed md:inset-y-0 transition-all ease-in-out duration-200 shadow-md z-40',
|
||||
isCollapsed ? 'md:w-12' : 'md:w-48'
|
||||
)}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user