Hide add column icon when disable column addition flag is set
This commit is contained in:
parent
b79f466324
commit
933545ccf7
|
@ -4,8 +4,14 @@
|
||||||
import HeaderCell from "../cells/HeaderCell.svelte"
|
import HeaderCell from "../cells/HeaderCell.svelte"
|
||||||
import { Icon } from "@budibase/bbui"
|
import { Icon } from "@budibase/bbui"
|
||||||
|
|
||||||
const { renderedColumns, dispatch, scroll, hiddenColumnsWidth, width } =
|
const {
|
||||||
getContext("grid")
|
renderedColumns,
|
||||||
|
dispatch,
|
||||||
|
scroll,
|
||||||
|
hiddenColumnsWidth,
|
||||||
|
width,
|
||||||
|
config,
|
||||||
|
} = getContext("grid")
|
||||||
|
|
||||||
$: columnsWidth = $renderedColumns.reduce(
|
$: columnsWidth = $renderedColumns.reduce(
|
||||||
(total, col) => (total += col.width),
|
(total, col) => (total += col.width),
|
||||||
|
@ -23,13 +29,15 @@
|
||||||
{/each}
|
{/each}
|
||||||
</div>
|
</div>
|
||||||
</GridScrollWrapper>
|
</GridScrollWrapper>
|
||||||
<div
|
{#if $config.allowAddColumns}
|
||||||
class="add"
|
<div
|
||||||
style="left:{left}px"
|
class="add"
|
||||||
on:click={() => dispatch("add-column")}
|
style="left:{left}px"
|
||||||
>
|
on:click={() => dispatch("add-column")}
|
||||||
<Icon name="Add" />
|
>
|
||||||
</div>
|
<Icon name="Add" />
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|
Loading…
Reference in New Issue