Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
3bc5e1d0e2 | |||
96a88112dc | |||
6c0c1e165f | |||
653a4138a9 |
4
package-lock.json
generated
4
package-lock.json
generated
@ -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",
|
||||
|
@ -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",
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user