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> <body>
<lavender-widgets></lavender-widgets> <lavender-widgets></lavender-widgets>
<div class="link-box"> <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> <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> </div>
<script> <script>

View File

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