fix(core): update

This commit is contained in:
Philipp Kunz 2020-12-07 04:07:32 +00:00
parent 37d343da03
commit 97b88d965c

View File

@ -102,7 +102,7 @@ export class WccDashboard extends LitElement {
if (typeof this.selectedItem === 'function') { if (typeof this.selectedItem === 'function') {
return this.selectedItem(); return this.selectedItem();
} else { } else {
console.error('The selected item looks strange:') console.error('The selected item looks strange:');
console.log(this.selectedItem); console.log(this.selectedItem);
} }
} else if (this.selectedType === 'element' && this.selectedItem) { } else if (this.selectedType === 'element' && this.selectedItem) {
@ -138,7 +138,9 @@ export class WccDashboard extends LitElement {
public async firstUpdated() { public async firstUpdated() {
this.domtools = await plugins.deesDomtools.DomTools.setupDomTools(); this.domtools = await plugins.deesDomtools.DomTools.setupDomTools();
this.domtools.router.on('/wcctools-route/:itemType/:itemName/:viewport/:theme', async (routeInfo) => { this.domtools.router.on(
'/wcctools-route/:itemType/:itemName/:viewport/:theme',
async (routeInfo) => {
this.selectedType = routeInfo.params.itemType as TElementType; this.selectedType = routeInfo.params.itemType as TElementType;
this.selectedItemName = routeInfo.params.itemName; this.selectedItemName = routeInfo.params.itemName;
this.selectedViewport = routeInfo.params.viewport as TViewport; this.selectedViewport = routeInfo.params.viewport as TViewport;
@ -150,10 +152,11 @@ export class WccDashboard extends LitElement {
} }
const domtoolsInstance = await plugins.deesDomtools.elementBasic.setup(); const domtoolsInstance = await plugins.deesDomtools.elementBasic.setup();
domtoolsInstance.setVirtualViewport(routeInfo.params.viewport as TViewport); domtoolsInstance.setVirtualViewport(routeInfo.params.viewport as TViewport);
this.selectedTheme === 'bright' ? this.selectedTheme === 'bright'
domtoolsInstance.themeManager.goBright() : ? domtoolsInstance.themeManager.goBright()
domtoolsInstance.themeManager.goDark(); : domtoolsInstance.themeManager.goDark();
}); }
);
} }
private updating = false; private updating = false;
@ -178,9 +181,7 @@ export class WccDashboard extends LitElement {
public buildUrl() { public buildUrl() {
this.domtools.router.pushUrl( this.domtools.router.pushUrl(
`/wcctools-route/${this.selectedType}/${this.selectedItemName}/${this.selectedViewport}/${ `/wcctools-route/${this.selectedType}/${this.selectedItemName}/${this.selectedViewport}/${this.selectedTheme}`
this.selectedTheme
}`
); );
} }
} }