Compare commits

...

4 Commits

Author SHA1 Message Date
3bc5e1d0e2 2.0.17 2022-04-22 09:25:10 +02:00
96a88112dc fix(core): update 2022-04-22 09:25:10 +02:00
6c0c1e165f 2.0.16 2022-04-21 23:53:02 +02:00
653a4138a9 fix(core): update 2022-04-21 23:53:02 +02:00
4 changed files with 20 additions and 7 deletions

4
package-lock.json generated
View File

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

View File

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

View File

@ -146,6 +146,21 @@ export class DomTools {
this.elements.headElement.appendChild(styleElement);
}
/**
* allows to set global styles
* @param stylesText the css text you want to set
*/
public async setExternalScript(scriptLinkArg: string) {
await this.domReady.promise;
const done = plugins.smartpromise.defer();
const script = document.createElement('script')
script.src = scriptLinkArg;
script.addEventListener('load', function() {
done.resolve();
});
await done.promise;
}
/**
* allows setting external css files
* @param cssLinkArg a url to an external stylesheet

View File

@ -128,8 +128,6 @@ export enum Key {
Quote = 222,
}
type KeyCombo = Array<Key>;
export class Keyboard {
private mapCombosToHandlers = new Map<number[], plugins.smartrx.rxjs.Subject<KeyboardEvent>>();
private pressedKeys = new Set<Key>();
@ -176,10 +174,10 @@ export class Keyboard {
this.pressedKeys.delete(event.keyCode);
};
private areAllKeysPressed(combo: number[]) {
private areAllKeysPressed(keysArg: Key[]) {
let result = true;
combo.forEach((key) => {
keysArg.forEach((key) => {
if (!this.pressedKeys.has(key)) {
result = false;
}