Update settings bar to account for new block settings structure

This commit is contained in:
Andrew Kingston 2021-11-12 14:48:53 +00:00
parent 3db35d3af9
commit aaa448cca8
2 changed files with 13 additions and 1 deletions

View File

@ -17,7 +17,19 @@
$: definition = $builderStore.selectedComponentDefinition
$: showBar = definition?.showSettingsBar && !$builderStore.isDragging
$: settings = definition?.settings?.filter(setting => setting.showInBar) ?? []
$: settings = getBarSettings(definition)
const getBarSettings = definition => {
let allSettings = []
definition?.settings?.forEach(setting => {
if (setting.section) {
allSettings = allSettings.concat(setting.settings || [])
} else {
allSettings.push(setting)
}
})
return allSettings.filter(setting => setting.showInBar)
}
const updatePosition = () => {
if (!showBar) {