Compare commits

...

2 Commits

Author SHA1 Message Date
f5fd0662d3 1.0.100 2021-11-26 15:26:16 +01:00
14c91ed81f fix(core): update 2021-11-26 15:26:15 +01:00
4 changed files with 17 additions and 7 deletions

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{ {
"name": "@designestate/dees-domtools", "name": "@designestate/dees-domtools",
"version": "1.0.99", "version": "1.0.100",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "@designestate/dees-domtools", "name": "@designestate/dees-domtools",
"version": "1.0.99", "version": "1.0.100",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@apiglobal/typedrequest": "^1.0.65", "@apiglobal/typedrequest": "^1.0.65",

View File

@ -1,6 +1,6 @@
{ {
"name": "@designestate/dees-domtools", "name": "@designestate/dees-domtools",
"version": "1.0.99", "version": "1.0.100",
"private": false, "private": false,
"description": "tools to simplify complex css structures", "description": "tools to simplify complex css structures",
"main": "dist_ts/index.js", "main": "dist_ts/index.js",

View File

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

View File

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