minor app improvements

This commit is contained in:
Ruben Fiszel
2023-03-20 08:26:02 +01:00
parent 1392bebf87
commit 211ad52edb
4 changed files with 7 additions and 5 deletions

View File

@@ -135,6 +135,7 @@
<div class="text-red-500 text-xs">{errorsMessage}</div>
{/if}
<Button
on:pointerdown={(e) => e.stopPropagation()}
btnClasses={twMerge(
$app.css?.['buttoncomponent']?.['button']?.class,
customCss?.button?.class,

View File

@@ -28,9 +28,10 @@
{#if selected || hover}
<span
draggable="false"
title={`Id: ${component.id}`}
class={twMerge(
'px-2 text-2xs font-semibold w-fit absolute shadow -top-[9px] -left-[8px] border rounded-sm z-50',
'px-2 text-2xs font-semibold w-fit absolute shadow -top-[9px] -left-[8px] border rounded-sm z-50 cursor-move',
selected
? 'bg-indigo-500/90 border-indigo-600 text-white'
: 'bg-blue-500/90 border-blue-600 text-white'
@@ -69,6 +70,7 @@
{/if}
</button>
<span
draggable="false"
title="Move"
on:mousedown|stopPropagation|capture
class={classNames(

View File

@@ -51,7 +51,7 @@
const editorContext = getContext<AppEditorContext>('AppEditorContext')
const movingcomponent = editorContext?.movingcomponent
$: ismoving = movingcomponent != undefined && $movingcomponent === component.id
$: ismoving = movingcomponent != undefined && $mode == 'dnd' && $movingcomponent === component.id
let initializing: boolean | undefined = undefined
let componentContainerHeight: number = 0

View File

@@ -157,11 +157,10 @@
cordDiff = { x: 0, y: 0 }
computeRect(target)
startDrag = setTimeout(() => {
active = true
trans = false
computeRect(target)
}, 200)
_scrollTop = scrollElement.scrollTop
@@ -307,7 +306,7 @@
on:click|stopPropagation={() => {
startDrag && clearTimeout(startDrag)
}}
on:pointerdown|stopPropagation={pointerdown}
on:pointerdown|stopPropagation|preventDefault={pointerdown}
class="svlt-grid-item"
class:svlt-grid-active={active || (trans && rect)}
style="width: {active ? newSize.width : width}px; height:{active