fix(core): update

This commit is contained in:
Philipp Kunz 2020-05-27 21:59:28 +00:00
parent ac18ed0684
commit f41550fa22

View File

@ -31,7 +31,15 @@ export class DomTools {
}
public smartstate = new plugins.smartstate.Smartstate();
public domToolsStatePart = this.smartstate.getStatePart<IDomToolsState>('domtools');
public domToolsStatePart = this.smartstate.getStatePart<IDomToolsState>('domtools', {
virtualViewport: 'native'
});
public actionSetVirtualViewport = this.domToolsStatePart.createAction<TViewport>(async (statePart, payload) => {
const currentState = statePart.getState();
currentState.virtualViewport = payload;
return currentState;
});
public domToolsReady = plugins.smartpromise.defer();
public domReady = plugins.smartpromise.defer();
@ -46,7 +54,9 @@ export class DomTools {
bodyElement: null
};
constructor() {}
constructor() {
}
public async setGlobalStyles(stylesText: string) {
await this.domReady.promise;
@ -82,5 +92,7 @@ export class DomTools {
);
}
setVirtualViewport() {}
setVirtualViewport(environmentArg: TViewport) {
this.domToolsStatePart.dispatchAction(this.actionSetVirtualViewport, environmentArg);
}
}