cleanup component selection list
This commit is contained in:
parent
c97fc61f77
commit
e0a376dd7b
|
@ -32,11 +32,8 @@
|
||||||
return enrichedStructure
|
return enrichedStructure
|
||||||
}
|
}
|
||||||
|
|
||||||
const onItemChosen = async (item, idx) => {
|
const onItemChosen = async (item) => {
|
||||||
if (item.isCategory) {
|
if (!item.isCategory) {
|
||||||
// Select and open this category
|
|
||||||
selectedIndex = idx
|
|
||||||
} else {
|
|
||||||
// Add this component
|
// Add this component
|
||||||
await store.actions.components.create(item.component)
|
await store.actions.components.create(item.component)
|
||||||
}
|
}
|
||||||
|
@ -44,15 +41,14 @@
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<ActionGroup>
|
<ActionGroup>
|
||||||
{#each enrichedStructure as item, idx}
|
{#each enrichedStructure as item}
|
||||||
<ActionMenu disabled={!item.isCategory}>
|
<ActionMenu disabled={!item.isCategory}>
|
||||||
<ActionButton
|
<ActionButton
|
||||||
icon={item.icon}
|
icon={item.icon}
|
||||||
size="XS"
|
|
||||||
primary
|
primary
|
||||||
quiet
|
quiet
|
||||||
slot="button"
|
slot="control"
|
||||||
on:click={() => onItemChosen(item, idx)}
|
on:click={() => onItemChosen(item)}
|
||||||
>
|
>
|
||||||
{item.name}
|
{item.name}
|
||||||
</ActionButton>
|
</ActionButton>
|
||||||
|
|
Loading…
Reference in New Issue