fix(core): update

This commit is contained in:
Philipp Kunz 2022-04-22 09:25:10 +02:00
parent 6c0c1e165f
commit 96a88112dc
2 changed files with 17 additions and 2 deletions

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

@ -174,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;
}