move onSelect method ComponentsHierarchyChildren

This commit is contained in:
kevmodrome 2020-05-01 17:39:50 +02:00
parent 09248d4d22
commit 59624741de
3 changed files with 7 additions and 6 deletions

View File

@ -49,7 +49,6 @@
} }
const changeScreen = screen => { const changeScreen = screen => {
console.log("Screen: ", screen)
store.setCurrentScreen(screen.title) store.setCurrentScreen(screen.title)
$goto(`./:page/${screen.title}`) $goto(`./:page/${screen.title}`)
} }
@ -82,7 +81,6 @@
<ComponentsHierarchyChildren <ComponentsHierarchyChildren
components={screen.component.props._children} components={screen.component.props._children}
currentComponent={$store.currentComponentInfo} currentComponent={$store.currentComponentInfo}
onSelect={store.selectComponent}
onDeleteComponent={confirmDeleteComponent} onDeleteComponent={confirmDeleteComponent}
onMoveUpComponent={store.moveUpComponent} onMoveUpComponent={store.moveUpComponent}
onMoveDownComponent={store.moveDownComponent} onMoveDownComponent={store.moveDownComponent}

View File

@ -1,4 +1,5 @@
<script> <script>
import { store } from "builderStore"
import { last } from "lodash/fp" import { last } from "lodash/fp"
import { pipe } from "../common/core" import { pipe } from "../common/core"
import { import {
@ -16,6 +17,7 @@
export let onMoveUpComponent export let onMoveUpComponent
export let onMoveDownComponent export let onMoveDownComponent
export let onCopyComponent export let onCopyComponent
export let ids = []
const capitalise = s => s.substring(0, 1).toUpperCase() + s.substring(1) const capitalise = s => s.substring(0, 1).toUpperCase() + s.substring(1)
const get_name = s => (!s ? "" : last(s.split("/"))) const get_name = s => (!s ? "" : last(s.split("/")))
@ -28,11 +30,15 @@
return onMoveDownComponent(c) return onMoveDownComponent(c)
} }
} }
const selectComponent = (ids, component) => {
store.selectComponent(component)
}
</script> </script>
<ul> <ul>
{#each components as component, index (component._id)} {#each components as component, index (component._id)}
<li on:click|stopPropagation={() => onSelect(component)}> <li on:click|stopPropagation={() => selectComponent(ids, component)}>
<div <div
class="budibase__nav-item item" class="budibase__nav-item item"
class:selected={currentComponent === component} class:selected={currentComponent === component}

View File

@ -73,7 +73,6 @@
<ComponentsHierarchyChildren <ComponentsHierarchyChildren
components={_layout.component.props._children} components={_layout.component.props._children}
currentComponent={$store.currentComponentInfo} currentComponent={$store.currentComponentInfo}
onSelect={store.selectComponent}
onDeleteComponent={confirmDeleteComponent} onDeleteComponent={confirmDeleteComponent}
onMoveUpComponent={store.moveUpComponent} onMoveUpComponent={store.moveUpComponent}
onMoveDownComponent={store.moveDownComponent} onMoveDownComponent={store.moveDownComponent}
@ -103,8 +102,6 @@
.pagelayoutSection { .pagelayoutSection {
margin: 20px 0px 20px 0px; margin: 20px 0px 20px 0px;
} }
.root {
}
.title { .title {
margin-left: 10px; margin-left: 10px;
font-size: 13px; font-size: 13px;