Compare commits

...

6 Commits

Author SHA1 Message Date
ebc2c82b7f 1.0.37 2020-07-15 21:30:02 +00:00
15481c5e24 fix(core): update 2020-07-15 21:30:01 +00:00
357320d40a 1.0.36 2020-07-15 21:00:48 +00:00
08d92d9d3e fix(core): update 2020-07-15 21:00:47 +00:00
0ce9a96b90 1.0.35 2020-07-15 20:42:55 +00:00
959a4cae89 fix(core): update 2020-07-15 20:42:54 +00:00
4 changed files with 22 additions and 19 deletions

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{ {
"name": "@designestate/dees-wcctools", "name": "@designestate/dees-wcctools",
"version": "1.0.34", "version": "1.0.37",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {

View File

@ -1,6 +1,6 @@
{ {
"name": "@designestate/dees-wcctools", "name": "@designestate/dees-wcctools",
"version": "1.0.34", "version": "1.0.37",
"private": false, "private": false,
"description": "wcc tools for creating element catalogues", "description": "wcc tools for creating element catalogues",
"main": "dist_ts_web/index.js", "main": "dist_ts_web/index.js",

View File

@ -37,18 +37,6 @@ export class WccDashboard extends LitElement {
if (pagesArg) { if (pagesArg) {
this.pages = 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];
});
} }
public render(): TemplateResult { public render(): TemplateResult {
@ -65,7 +53,7 @@ export class WccDashboard extends LitElement {
display: none; display: none;
} }
</style> </style>
<wcc-sidebar .dashboardRef=${this} @selectedItem=${eventArg => { <wcc-sidebar .dashboardRef=${this} .selectedItem=${this.selectedItem} @selectedItem=${eventArg => {
this.selectedItem = eventArg.detail; this.selectedItem = eventArg.detail;
}}></wcc-sidebar> }}></wcc-sidebar>
<wcc-properties .warning="${this.warning}" .selectedItem=${this.selectedItem} @selectedViewport=${eventArg => {this.selectedViewport = eventArg.detail; this.updateSlot();}}></wcc-properties> <wcc-properties .warning="${this.warning}" .selectedItem=${this.selectedItem} @selectedViewport=${eventArg => {this.selectedViewport = eventArg.detail; this.updateSlot();}}></wcc-properties>
@ -121,4 +109,16 @@ export class WccDashboard extends LitElement {
}, 0); }, 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();
}
} }

View File

@ -1,3 +1,4 @@
import * as plugins from '../wcctools.plugins';
import { LitElement, property, html, customElement, TemplateResult } from 'lit-element'; import { LitElement, property, html, customElement, TemplateResult } from 'lit-element';
import { WccDashboard } from './wcc-dashboard'; import { WccDashboard } from './wcc-dashboard';
@ -104,9 +105,10 @@ export class WccSidebar extends LitElement {
return html` return html`
<div <div
class="selectOption ${this.selectedItem === item ? 'selected' : console.log('hi')}" class="selectOption ${this.selectedItem === item ? 'selected' : console.log('hi')}"
@click=${() => { @click=${async () => {
const domtools = await plugins.deesDomtools.DomTools.setupDomTools();
this.selectItem(item); this.selectItem(item);
this.dashboardRef.domtools.router.pushUrl(`/pages/${pageName}`); domtools.router.pushUrl(`/pages/${pageName}`);
}} }}
> >
<i class="material-icons">insert_drive_file</i> <i class="material-icons">insert_drive_file</i>
@ -123,9 +125,10 @@ export class WccSidebar extends LitElement {
return html` return html`
<div <div
class="selectOption ${this.selectedItem === item ? 'selected' : console.log('hi')}" class="selectOption ${this.selectedItem === item ? 'selected' : console.log('hi')}"
@click=${() => { @click=${async () => {
const domtools = await plugins.deesDomtools.DomTools.setupDomTools();
this.selectItem(item); this.selectItem(item);
this.dashboardRef.domtools.router.pushUrl(`/elements/${elementName}`); domtools.router.pushUrl(`/elements/${elementName}`);
}} }}
> >
<i class="material-icons">featured_video</i> <i class="material-icons">featured_video</i>