removing old component actions
This commit is contained in:
parent
c87ddade50
commit
4934ed497d
|
@ -20,23 +20,6 @@ const showDropdown = () => {
|
||||||
dropdown.show()
|
dropdown.show()
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
{#if index > 0}
|
|
||||||
<button
|
|
||||||
class:solo={index === components.length - 1}
|
|
||||||
on:click|stopPropagation={() => onMoveUpComponent(component)}>
|
|
||||||
<ChevronUpIcon />
|
|
||||||
</button>
|
|
||||||
{/if}
|
|
||||||
{#if index < components.length - 1}
|
|
||||||
<button
|
|
||||||
class:solo={index === 0}
|
|
||||||
on:click|stopPropagation={moveDownComponent(component)}>
|
|
||||||
<ChevronDownIcon />
|
|
||||||
</button>
|
|
||||||
{/if}
|
|
||||||
*/
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="root" on:click|stopPropagation={() => {}}>
|
<div class="root" on:click|stopPropagation={() => {}}>
|
||||||
|
@ -77,8 +60,9 @@ const showDropdown = () => {
|
||||||
border-style: none;
|
border-style: none;
|
||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
background: var(--grey);
|
background: transparent;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
color: var(--button-text)
|
||||||
}
|
}
|
||||||
|
|
||||||
.menu {
|
.menu {
|
||||||
|
|
|
@ -72,11 +72,7 @@
|
||||||
{#if $store.currentPreviewItem.name === screen.title && screen.component.props._children}
|
{#if $store.currentPreviewItem.name === screen.title && screen.component.props._children}
|
||||||
<ComponentsHierarchyChildren
|
<ComponentsHierarchyChildren
|
||||||
components={screen.component.props._children}
|
components={screen.component.props._children}
|
||||||
currentComponent={$store.currentComponentInfo}
|
currentComponent={$store.currentComponentInfo} />
|
||||||
onDeleteComponent={confirmDeleteComponent}
|
|
||||||
onMoveUpComponent={store.moveUpComponent}
|
|
||||||
onMoveDownComponent={store.moveDownComponent}
|
|
||||||
onCopyComponent={store.copyComponent} />
|
|
||||||
{/if}
|
{/if}
|
||||||
{/each}
|
{/each}
|
||||||
|
|
||||||
|
|
|
@ -15,23 +15,13 @@
|
||||||
export let currentComponent
|
export let currentComponent
|
||||||
export let onSelect = () => {}
|
export let onSelect = () => {}
|
||||||
export let level = 0
|
export let level = 0
|
||||||
export let onDeleteComponent
|
|
||||||
export let onMoveUpComponent
|
|
||||||
export let onMoveDownComponent
|
|
||||||
export let onCopyComponent
|
|
||||||
|
|
||||||
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("/")))
|
||||||
|
|
||||||
const get_capitalised_name = name => pipe(name, [get_name, capitalise])
|
const get_capitalised_name = name => pipe(name, [get_name, capitalise])
|
||||||
|
|
||||||
const moveDownComponent = component => {
|
|
||||||
const c = component
|
|
||||||
return () => {
|
|
||||||
return onMoveDownComponent(c)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const selectComponent = component => {
|
const selectComponent = component => {
|
||||||
// Set current component
|
// Set current component
|
||||||
store.selectComponent(component)
|
store.selectComponent(component)
|
||||||
|
@ -62,11 +52,7 @@
|
||||||
components={component._children}
|
components={component._children}
|
||||||
{currentComponent}
|
{currentComponent}
|
||||||
{onSelect}
|
{onSelect}
|
||||||
level={level + 1}
|
level={level + 1} />
|
||||||
{onDeleteComponent}
|
|
||||||
{onMoveUpComponent}
|
|
||||||
{onMoveDownComponent}
|
|
||||||
{onCopyComponent} />
|
|
||||||
{/if}
|
{/if}
|
||||||
</li>
|
</li>
|
||||||
{/each}
|
{/each}
|
||||||
|
|
|
@ -68,11 +68,7 @@
|
||||||
<ComponentsHierarchyChildren
|
<ComponentsHierarchyChildren
|
||||||
thisComponent={_layout.component.props}
|
thisComponent={_layout.component.props}
|
||||||
components={_layout.component.props._children}
|
components={_layout.component.props._children}
|
||||||
currentComponent={$store.currentComponentInfo}
|
currentComponent={$store.currentComponentInfo} />
|
||||||
onDeleteComponent={confirmDeleteComponent}
|
|
||||||
onMoveUpComponent={store.moveUpComponent}
|
|
||||||
onMoveDownComponent={store.moveDownComponent}
|
|
||||||
onCopyComponent={store.copyComponent} />
|
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue