Hide resize indicators when they don't fit
This commit is contained in:
parent
aaa33acc1c
commit
8aa0407236
|
@ -34,6 +34,8 @@
|
|||
class:line
|
||||
style="top: {top}px; left: {left}px; width: {width}px; height: {height}px; --color: {color}; --zIndex: {zIndex};"
|
||||
class:withText={!!text}
|
||||
class:vCompact={height < 40}
|
||||
class:hCompact={width < 40}
|
||||
>
|
||||
{#if text || icon}
|
||||
<div class="label" class:flipped class:line class:right={alignRight}>
|
||||
|
@ -153,15 +155,23 @@
|
|||
}
|
||||
.anchor.right .anchor-inner,
|
||||
.anchor.left .anchor-inner {
|
||||
height: calc(var(--size) * 1.4);
|
||||
height: calc(var(--size) * 1.2);
|
||||
width: calc(var(--size) * 0.3);
|
||||
}
|
||||
.anchor.top .anchor-inner,
|
||||
.anchor.bottom .anchor-inner {
|
||||
width: calc(var(--size) * 1.4);
|
||||
width: calc(var(--size) * 1.2);
|
||||
height: calc(var(--size) * 0.3);
|
||||
}
|
||||
|
||||
/* Hide side indicators when they don't fit */
|
||||
.indicator.hCompact .anchor.top,
|
||||
.indicator.hCompact .anchor.bottom,
|
||||
.indicator.vCompact .anchor.left,
|
||||
.indicator.vCompact .anchor.right {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* Anchor positions */
|
||||
.anchor.right {
|
||||
left: calc(100% + 1px);
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
<script>
|
||||
import { onMount, onDestroy } from "svelte"
|
||||
import Indicator from "./Indicator.svelte"
|
||||
import { componentStore, builderStore } from "stores"
|
||||
import { builderStore } from "stores"
|
||||
import { memo, Utils } from "@budibase/frontend-core"
|
||||
import { writable } from "svelte/store"
|
||||
import { isGridChild } from "utils/grid"
|
||||
|
||||
export let componentId = null
|
||||
|
@ -51,15 +50,8 @@
|
|||
})
|
||||
$: $config, debouncedUpdate()
|
||||
|
||||
// Update position when component state changes
|
||||
$: instance = componentStore.actions.getComponentInstance(componentId)
|
||||
$: componentState = $instance?.state || writable()
|
||||
$: $componentState, debouncedUpdate()
|
||||
|
||||
const checkInsideGrid = id => {
|
||||
const component = document.getElementsByClassName(id)[0]
|
||||
const domNode = component?.children[0]
|
||||
return isGridChild(domNode)
|
||||
return isGridChild(document.getElementsByClassName(id)[0])
|
||||
}
|
||||
|
||||
const createIntersectionCallback = idx => entries => {
|
||||
|
|
Loading…
Reference in New Issue