fix(core): update

This commit is contained in:
Philipp Kunz 2021-11-26 15:26:15 +01:00
parent 1aabacdf87
commit 14c91ed81f
2 changed files with 14 additions and 4 deletions

View File

@ -110,6 +110,7 @@ export class DomTools {
private runOnceTrackerStringMap = new Stringmap();
private runOnceResultMap = new FastMap();
/**
* run a function once and always get the Promise of the first execution
* @param identifierArg the indentifier arg identifies functions. functions with the same identifier are considered equal
@ -135,7 +136,10 @@ export class DomTools {
}
// setStuff
/**
* allows to set global styles
* @param stylesText the css text you want to set
*/
public async setGlobalStyles(stylesText: string) {
await this.domReady.promise;
const styleElement = document.createElement('style');
@ -144,6 +148,10 @@ export class DomTools {
this.elements.headElement.appendChild(styleElement);
}
/**
* allows setting external css files
* @param cssLinkArg a url to an external stylesheet
*/
public async setExternalCss(cssLinkArg: string) {
const cssTag = document.createElement('link');
cssTag.rel = 'stylesheet';
@ -152,8 +160,10 @@ export class DomTools {
document.head.append(cssTag);
}
/**
* allows setting of website infos
* @param optionsArg the website info
*/
public async setWebsiteInfo(optionsArg: plugins.websetup.IWebSetupConstructorOptions) {
await this.websetup.setup(optionsArg);
await this.websetup.readyPromise;

View File

@ -5,7 +5,7 @@ import { DomTools } from './domtools.classes.domtools';
*/
export const scrollBarStyles = (() => {
const returnStyles =
navigator.userAgent.indexOf('Windows') !== -1
navigator.userAgent.indexOf('Mac OS X') !== -1
? `
/* width */
::-webkit-scrollbar {