Allow indicator to be shown for hovering and selecting navigation section, including title and icon
This commit is contained in:
parent
b281e233b3
commit
c2a40dc88e
|
@ -13,9 +13,11 @@
|
||||||
let indicators = []
|
let indicators = []
|
||||||
let interval
|
let interval
|
||||||
let text
|
let text
|
||||||
|
let icon
|
||||||
|
|
||||||
$: visibleIndicators = indicators.filter(x => x.visible)
|
$: visibleIndicators = indicators.filter(x => x.visible)
|
||||||
$: offset = $builderStore.inBuilder ? 0 : 2
|
$: offset = $builderStore.inBuilder ? 0 : 2
|
||||||
$: icon = getComponentIcon(componentId)
|
$: getComponentIcon(componentId)
|
||||||
|
|
||||||
let updating = false
|
let updating = false
|
||||||
let observers = []
|
let observers = []
|
||||||
|
@ -24,12 +26,14 @@
|
||||||
|
|
||||||
const getComponentIcon = id => {
|
const getComponentIcon = id => {
|
||||||
if (!id) {
|
if (!id) {
|
||||||
return null
|
return
|
||||||
}
|
}
|
||||||
const component = componentStore.actions.getComponentById(id)
|
const component = componentStore.actions.getComponentById(id)
|
||||||
const type = component?._component
|
const type = component?._component
|
||||||
const definition = componentStore.actions.getComponentDefinition(type)
|
const definition = componentStore.actions.getComponentDefinition(type)
|
||||||
return definition?.icon
|
if (definition?.icon) {
|
||||||
|
icon = definition.icon
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const createIntersectionCallback = idx => entries => {
|
const createIntersectionCallback = idx => entries => {
|
||||||
|
@ -68,6 +72,9 @@
|
||||||
if (prefix) {
|
if (prefix) {
|
||||||
text = `${prefix} ${text}`
|
text = `${prefix} ${text}`
|
||||||
}
|
}
|
||||||
|
if (parents[0].dataset.icon) {
|
||||||
|
icon = parents[0].dataset.icon
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Batch reads to minimize reflow
|
// Batch reads to minimize reflow
|
||||||
|
|
Loading…
Reference in New Issue