mirror of
https://github.com/keymanapp/keyman.git
synced 2026-09-24 08:37:42 +00:00
chore(web): resolves domOverrides.ts
This commit is contained in:
parent
d436639ae4
commit
2d6f80f2c9
2 changed files with 4 additions and 15 deletions
|
|
@ -80,11 +80,10 @@ export default class LanguageProcessor extends EventEmitter<LanguageProcessorEve
|
|||
maxRightContextCodePoints: supportsRightDeletions ? 0 : 64
|
||||
}
|
||||
|
||||
if(!this.canEnable() || !predictiveTextWorker) {
|
||||
if(!predictiveTextWorker) {
|
||||
return;
|
||||
}
|
||||
|
||||
// TODO: this needs to be supplied separately - runs on Node need to refer to a different type!
|
||||
this.lmEngine = new LMLayer(capabilities, predictiveTextWorker);
|
||||
}
|
||||
|
||||
|
|
@ -392,9 +391,9 @@ export default class LanguageProcessor extends EventEmitter<LanguageProcessorEve
|
|||
return (this.activeModel || false) && this._mayPredict;
|
||||
}
|
||||
|
||||
public canEnable(): boolean {
|
||||
// Is overridden for dom-aware KMW in case of old IE versions.
|
||||
return true;
|
||||
canEnable(): boolean {
|
||||
// Is not initialized if there is no worker.
|
||||
return !!this.lmEngine;
|
||||
}
|
||||
|
||||
public get mayPredict() {
|
||||
|
|
|
|||
|
|
@ -1,10 +0,0 @@
|
|||
namespace com.keyman.dom {
|
||||
text.prediction.LanguageProcessor.prototype.canEnable = function(): boolean {
|
||||
if(typeof Worker != 'function') {
|
||||
console.warn("WebWorkers are not supported by this browser.");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue