convert modelcreator and vieweditor to new modal

This commit is contained in:
kevmodrome 2020-04-06 16:51:17 +02:00
parent 3ce9124d3d
commit b035c56522
3 changed files with 33 additions and 2 deletions

View File

@ -8,3 +8,9 @@
<section>
<ModelView />
</section>
<style>
section {
padding: 30px;
}
</style>

View File

@ -6,3 +6,9 @@
<section>
<IndexView />
</section>
<style>
section {
padding: 30px;
}
</style>

View File

@ -1,9 +1,16 @@
<script>
import { getContext } from "svelte"
import { store, backendUiStore } from "builderStore"
import HierarchyRow from "./HierarchyRow.svelte"
import DropdownButton from "components/common/DropdownButton.svelte"
import NavItem from "./NavItem.svelte"
import getIcon from "components/common/icon"
import {
CreateEditModelModal,
CreateEditViewModal,
} from "components/database/ModelDataTable/modals"
const { open, close } = getContext("simple-modal")
function newModel() {
if ($store.currentNode) {
@ -11,12 +18,24 @@
} else {
store.newRootRecord()
}
backendUiStore.actions.modals.show("MODEL")
open(
CreateEditModelModal,
{
onClosed: close,
},
{ styleContent: { padding: "0" } }
)
}
function newView() {
store.newRootIndex()
backendUiStore.actions.modals.show("VIEW")
open(
CreateEditViewModal,
{
onClosed: close,
},
{ styleContent: { padding: "0" } }
)
}
</script>