1
0
Fork 0
mirror of synced 2024-07-03 05:20:32 +12:00

Allow pasting inside screens on screens tab and fix icon overflow in nav items

This commit is contained in:
Andrew Kingston 2022-05-13 12:05:55 +01:00
parent 6f382b84c1
commit a7395a40cf
2 changed files with 21 additions and 4 deletions

View file

@ -135,8 +135,12 @@
padding-left: var(--spacing-l);
}
/* Needed to fully display the actions icon */
.nav-item.scrollable .nav-item-content {
padding-right: 1px;
}
.icon {
font-size: 16px;
flex: 0 0 24px;
display: flex;
flex-direction: row;
@ -164,9 +168,6 @@
.icon.arrow.opened {
transform: rotate(90deg);
}
.icon + .icon {
/*margin-left: -4px;*/
}
.iconText {
margin-top: 1px;
font-size: var(--spectrum-global-dimension-font-size-50);

View file

@ -21,6 +21,15 @@
let screenDetailsModal
$: screen = $store.screens.find(screen => screen._id === screenId)
$: noPaste = !$store.componentToPaste
const pasteComponent = mode => {
try {
store.actions.components.paste(screen.props, mode)
} catch (error) {
notifications.error("Error saving component")
}
}
const duplicateScreen = () => {
screenDetailsModal.show()
@ -69,6 +78,13 @@
<div slot="control" class="icon">
<Icon size="S" hoverable name="MoreSmallList" />
</div>
<MenuItem
icon="ShowOneLayer"
on:click={() => pasteComponent("inside")}
disabled={noPaste}
>
Paste inside
</MenuItem>
<MenuItem icon="Duplicate" on:click={duplicateScreen}>Duplicate</MenuItem>
<MenuItem icon="Delete" on:click={confirmDeleteDialog.show}>Delete</MenuItem>
</ActionMenu>