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