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