From 08d92d9d3e04255802a8eb7728f4affba27ef0bd Mon Sep 17 00:00:00 2001 From: Phil Kunz Date: Wed, 15 Jul 2020 21:00:47 +0000 Subject: [PATCH] fix(core): update --- ts_web/elements/wcc-dashboard.ts | 25 ++++++++++++------------- ts_web/elements/wcc-sidebar.ts | 11 +++++++---- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/ts_web/elements/wcc-dashboard.ts b/ts_web/elements/wcc-dashboard.ts index 11dc83f..726c521 100644 --- a/ts_web/elements/wcc-dashboard.ts +++ b/ts_web/elements/wcc-dashboard.ts @@ -37,19 +37,6 @@ export class WccDashboard extends LitElement { if (pagesArg) { this.pages = pagesArg; } - this.init(); - } - - public async init() { - this.domtools = await plugins.deesDomtools.DomTools.setupDomTools(); - this.domtools.router.on('/elements/:elementName', async routeInfo => { - this.selectedItem = this.elements[routeInfo.params.elementName]; - }); - - this.domtools.router.on('/pages/:pageName', async routeInfo => { - this.selectedItem = this.pages[routeInfo.params.pageName]; - }); - this.domtools.router._handleRouteState(); } public render(): TemplateResult { @@ -122,4 +109,16 @@ export class WccDashboard extends LitElement { }, 0); } } + + public async firstUpdated() { + this.domtools = await plugins.deesDomtools.DomTools.setupDomTools(); + this.domtools.router.on('/elements/:elementName', async routeInfo => { + this.selectedItem = this.elements[routeInfo.params.elementName]; + }); + + this.domtools.router.on('/pages/:pageName', async routeInfo => { + this.selectedItem = this.pages[routeInfo.params.pageName]; + }); + this.domtools.router._handleRouteState(); + } } diff --git a/ts_web/elements/wcc-sidebar.ts b/ts_web/elements/wcc-sidebar.ts index 69d9f84..b20dc4e 100644 --- a/ts_web/elements/wcc-sidebar.ts +++ b/ts_web/elements/wcc-sidebar.ts @@ -1,3 +1,4 @@ +import * as plugins from '../wcctools.plugins'; import { LitElement, property, html, customElement, TemplateResult } from 'lit-element'; import { WccDashboard } from './wcc-dashboard'; @@ -104,9 +105,10 @@ export class WccSidebar extends LitElement { return html`
{ + @click=${async () => { + const domtools = await plugins.deesDomtools.DomTools.setupDomTools(); this.selectItem(item); - this.dashboardRef.domtools.router.pushUrl(`/pages/${pageName}`); + domtools.router.pushUrl(`/pages/${pageName}`); }} > insert_drive_file @@ -123,9 +125,10 @@ export class WccSidebar extends LitElement { return html`
{ + @click=${async () => { + const domtools = await plugins.deesDomtools.DomTools.setupDomTools(); this.selectItem(item); - this.dashboardRef.domtools.router.pushUrl(`/elements/${elementName}`); + domtools.router.pushUrl(`/elements/${elementName}`); }} > featured_video