1
0
Fork 0
mirror of synced 2024-10-05 12:34:50 +13:00

Hide add column icon when disable column addition flag is set

This commit is contained in:
Andrew Kingston 2023-04-28 11:37:38 +01:00
parent b79f466324
commit 933545ccf7

View file

@ -4,8 +4,14 @@
import HeaderCell from "../cells/HeaderCell.svelte"
import { Icon } from "@budibase/bbui"
const { renderedColumns, dispatch, scroll, hiddenColumnsWidth, width } =
getContext("grid")
const {
renderedColumns,
dispatch,
scroll,
hiddenColumnsWidth,
width,
config,
} = getContext("grid")
$: columnsWidth = $renderedColumns.reduce(
(total, col) => (total += col.width),
@ -23,13 +29,15 @@
{/each}
</div>
</GridScrollWrapper>
<div
class="add"
style="left:{left}px"
on:click={() => dispatch("add-column")}
>
<Icon name="Add" />
</div>
{#if $config.allowAddColumns}
<div
class="add"
style="left:{left}px"
on:click={() => dispatch("add-column")}
>
<Icon name="Add" />
</div>
{/if}
</div>
<style>