Browse Source

Update settings bar to account for new block settings structure

pull/3355/head
Andrew Kingston 5 years ago
parent
commit
8b3edeea3b
  1. 0
      packages/client/src/components/app/blocks/DataBlock.svelte
  2. 14
      packages/client/src/components/preview/SettingsBar.svelte

0
packages/client/src/components/app/blocks/DataBlock.svelte

14
packages/client/src/components/preview/SettingsBar.svelte

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

Loading…
Cancel
Save