add duplicate condition button
This commit is contained in:
parent
58b1d81d88
commit
019243a329
|
@ -101,6 +101,12 @@
|
|||
conditions = conditions.filter(link => link.id !== id)
|
||||
}
|
||||
|
||||
const duplicateCondition = id => {
|
||||
const condition = conditions.find(link => link.id === id);
|
||||
const duplicate = {...condition, id: generate()}
|
||||
conditions = [...conditions, duplicate]
|
||||
}
|
||||
|
||||
const handleFinalize = e => {
|
||||
updateConditions(e)
|
||||
dragDisabled = true
|
||||
|
@ -235,6 +241,12 @@
|
|||
bind:value={condition.referenceValue}
|
||||
/>
|
||||
{/if}
|
||||
<Icon
|
||||
name="Duplicate"
|
||||
hoverable
|
||||
size="S"
|
||||
on:click={() => duplicateCondition(condition.id)}
|
||||
/>
|
||||
<Icon
|
||||
name="Close"
|
||||
hoverable
|
||||
|
@ -273,7 +285,7 @@
|
|||
gap: var(--spacing-l);
|
||||
display: grid;
|
||||
align-items: center;
|
||||
grid-template-columns: auto 1fr auto 1fr 1fr 1fr 1fr auto;
|
||||
grid-template-columns: auto 1fr auto 1fr 1fr 1fr 1fr auto auto;
|
||||
border-radius: var(--border-radius-s);
|
||||
transition: background-color ease-in-out 130ms;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue