Update to edit page to not open new window

This commit is contained in:
William Moore 2023-06-06 17:07:17 -05:00
parent 1452667c63
commit 1f8d7ef881
2 changed files with 4 additions and 3 deletions

View File

@ -10,7 +10,7 @@
<body>
<lavender-widgets></lavender-widgets>
<div class="link-box">
<a href="./edit.html" class="edit-link" target="_blank" alt="Edit Widgets"><i class="fa-solid fa-pen-to-square"></i></a>
<a href="./edit.html" class="edit-link" alt="Edit Widgets"><i class="fa-solid fa-pen-to-square"></i></a>
<a href="https://rezrov.xyz/caranmegil/lavender" class="edit-link" target="_blank" alt="Source Code"><i class="fa-brands fa-square-git"></i></a>
</div>
<script>

View File

@ -65,7 +65,7 @@ export class LavenderConfigure extends LitElement {
save() {
const elems = this.shadowRoot?.children ?? null;
const widgets = elems ? elems?.item(1)?.children : null;
const widgets = elems ? elems?.item(2)?.children : null;
const widgetsLen = widgets ? widgets?.length : 0
const lavenderWidgets = [];
@ -87,7 +87,7 @@ export class LavenderConfigure extends LitElement {
}
localStorage.setItem('lavender-widgets', JSON.stringify(lavenderWidgets));
window.location.reload();
window.location.replace('./index.html');
}
override render() {
@ -96,6 +96,7 @@ export class LavenderConfigure extends LitElement {
return html`
<h1 class="centerit">Lavender Widget Editor</h1>
<button class="button" @click="${() => this.save()}">Save</button>
<div class="widgets">
${widgets.map((widget: any) => {
return html`