cleanup component selection list

This commit is contained in:
Keviin Åberg Kultalahti 2021-04-27 17:04:50 +02:00
parent c97fc61f77
commit e0a376dd7b
1 changed files with 5 additions and 9 deletions

View File

@ -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>