Update settings bar to account for new block settings structure
This commit is contained in:
parent
e0c88597a7
commit
8b3edeea3b
|
@ -17,7 +17,19 @@
|
||||||
|
|
||||||
$: definition = $builderStore.selectedComponentDefinition
|
$: definition = $builderStore.selectedComponentDefinition
|
||||||
$: showBar = definition?.showSettingsBar && !$builderStore.isDragging
|
$: 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 = () => {
|
const updatePosition = () => {
|
||||||
if (!showBar) {
|
if (!showBar) {
|
||||||
|
|
Loading…
Reference in New Issue