More conversions...

This commit is contained in:
Keviin Åberg Kultalahti 2021-04-26 14:31:32 +02:00
parent f63861771e
commit 3950e26ade
4 changed files with 11 additions and 27 deletions

View File

@ -28,7 +28,7 @@
</div>
<Popover bind:this={dropdown} {anchor} align="left">
<Menu>
<slot closeOnClick={closeOnClickWrapper} />
<slot open={show} closeOnClick={closeOnClickWrapper} />
</Menu>
</Popover>

View File

@ -32,8 +32,8 @@
}
</script>
<ActionMenu bind:this={dropdown} let:closeOnClick >
<div slot="button" class="icon" on:click={dropdown.show}>
<ActionMenu bind:this={dropdown} let:open let:closeOnClick >
<div slot="button" class="icon" on:click={open}>
<Icon s hoverable name="MoreSmallList" />
</div>
<MenuItem icon="Delete" on:click={closeOnClick(confirmDeleteDialog.show)}>Delete</MenuItem>

View File

@ -12,11 +12,6 @@
dropdown?.hide()
}
function showModal() {
hideEditor()
confirmDeleteDialog.show()
}
async function deleteQuery() {
await queries.delete(query)
notifications.success("Query deleted")
@ -24,8 +19,8 @@
}
</script>
<ActionMenu bind:this={dropdown} let:closeOnClick>
<div slot="button" class="icon" on:click={dropdown.show}>
<ActionMenu bind:this={dropdown} let:open let:closeOnClick>
<div slot="button" class="icon" on:click={open}>
<Icon s hoverable name="MoreSmallList" />
</div>
<MenuItem icon="Delete" on:click={closeOnClick(confirmDeleteDialog.show)}>Delete</MenuItem>

View File

@ -26,16 +26,6 @@
let templateScreens
let willBeDeleted
function showEditor() {
editorModal.show()
dropdown?.hide()
}
function hideEditor() {
editorModal.hide()
dropdown?.hide()
}
function showDeleteModal() {
const screens = $allScreens
templateScreens = screens.filter(
@ -44,7 +34,6 @@
willBeDeleted = ["All table data"].concat(
templateScreens.map((screen) => `Screen ${screen.props._instanceName}`)
)
hideEditor()
confirmDeleteDialog.show()
}
@ -57,13 +46,13 @@
if (wasSelectedTable._id === table._id) {
$goto("./table")
}
hideEditor()
editorModal.hide()
}
async function save() {
await tables.save(table)
notifications.success("Table renamed successfully")
hideEditor()
editorModal.hide()
}
function checkValid(evt) {
@ -75,12 +64,12 @@
}
</script>
<ActionMenu bind:this={dropdown}>
<div slot="button" class="icon" on:click={dropdown.show}>
<ActionMenu bind:this={dropdown} let:open let:closeOnClick>
<div slot="button" class="icon" on:click={open}>
<Icon s hoverable name="MoreSmallList" />
</div>
<MenuItem icon="Edit" on:click={showEditor}>Edit</MenuItem>
<MenuItem icon="Delete" on:click={showDeleteModal}>Delete</MenuItem>
<MenuItem icon="Edit" on:click={closeOnClick(editorModal.show)}>Edit</MenuItem>
<MenuItem icon="Delete" on:click={closeOnClick(showDeleteModal)}>Delete</MenuItem>
</ActionMenu>
<Modal bind:this={editorModal}>