From cfabb9e89b42b0fa0377ee562eec93613c5e40d8 Mon Sep 17 00:00:00 2001 From: bat Date: Sat, 25 Mar 2023 21:31:35 +0000 Subject: [PATCH] revert 36cae9c4554a27ddcac8b1a1f13d89f0bc81bc7d revert toggle editing (wrong branch) --- components/layout.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/components/layout.js b/components/layout.js index cf125d0..4665841 100644 --- a/components/layout.js +++ b/components/layout.js @@ -3,12 +3,6 @@ export class Layout extends HTMLElement { super() this.attachShadow({mode: 'open'}) this.header = document.createElement('m-header') - this.editing = false - this.header.editing = this.editing - this.header.addEventListener('click-edit', () => { - this.editing = !this.editing - this.header.editing = this.editing - }) this.shadowRoot.appendChild(this.header) this.load() addEventListener('hashchange', () => { @@ -45,6 +39,9 @@ export class Layout extends HTMLElement { } get path() { - return '/hello' + return new URL( + window.location.hash.slice(1) || '/', + window.location + ).pathname } } \ No newline at end of file