Support scrolling screens or folders into view when clicking
This commit is contained in:
parent
e68f1e33b9
commit
ed7a80ca6f
|
@ -20,8 +20,13 @@
|
||||||
let contentRef
|
let contentRef
|
||||||
$: selected && contentRef && scrollToView()
|
$: selected && contentRef && scrollToView()
|
||||||
|
|
||||||
function onIconClick(event) {
|
const onClick = () => {
|
||||||
event.stopPropagation()
|
scrollToView()
|
||||||
|
dispatch("click")
|
||||||
|
}
|
||||||
|
|
||||||
|
const onIconClick = e => {
|
||||||
|
e.stopPropagation()
|
||||||
dispatch("iconClick")
|
dispatch("iconClick")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,7 +49,7 @@
|
||||||
on:dragstart
|
on:dragstart
|
||||||
on:dragover
|
on:dragover
|
||||||
on:drop
|
on:drop
|
||||||
on:click
|
on:click={onClick}
|
||||||
ondragover="return false"
|
ondragover="return false"
|
||||||
ondragenter="return false"
|
ondragenter="return false"
|
||||||
>
|
>
|
||||||
|
|
|
@ -30,7 +30,9 @@
|
||||||
export let indent
|
export let indent
|
||||||
export let border
|
export let border
|
||||||
|
|
||||||
|
let folder
|
||||||
let routeManuallyOpened = false
|
let routeManuallyOpened = false
|
||||||
|
|
||||||
$: selectedScreen = $currentAsset
|
$: selectedScreen = $currentAsset
|
||||||
$: allScreens = getAllScreens(route)
|
$: allScreens = getAllScreens(route)
|
||||||
$: filteredScreens = getFilteredScreens(allScreens, $screenSearchString)
|
$: filteredScreens = getFilteredScreens(allScreens, $screenSearchString)
|
||||||
|
@ -85,8 +87,7 @@
|
||||||
<NavItem
|
<NavItem
|
||||||
icon="WebPage"
|
icon="WebPage"
|
||||||
indentLevel={indent || 1}
|
indentLevel={indent || 1}
|
||||||
selected={$store.selectedScreenId === screen.id &&
|
selected={$store.selectedScreenId === screen.id}
|
||||||
$store.currentView === "detail"}
|
|
||||||
opened={$store.selectedScreenId === screen.id}
|
opened={$store.selectedScreenId === screen.id}
|
||||||
text={ROUTE_NAME_MAP[screen.route]?.[screen.role] || screen.route}
|
text={ROUTE_NAME_MAP[screen.route]?.[screen.role] || screen.route}
|
||||||
withArrow={route.subpaths}
|
withArrow={route.subpaths}
|
||||||
|
|
Loading…
Reference in New Issue