feat(web): Adds 'force' parameter to removeKeyboards for unit test use

This commit is contained in:
jahorton 2020-03-24 12:42:57 +07:00
parent a79b4dfa5e
commit 39eb9bfabc
2 changed files with 14 additions and 4 deletions

View file

@ -1181,7 +1181,7 @@ namespace com.keyman.keyboards {
* @param {string} x keyboard name string
*
*/
removeKeyboards(x: string) {
removeKeyboards(x: string, force?: boolean) {
if(arguments.length == 0) {
return false;
}
@ -1205,7 +1205,16 @@ namespace com.keyman.keyboards {
if(j < 0) {
success = false;
}
}
}
for(i=0; i<arguments.length; i++) {
for(j=this.keyboards.length-1; j>=0; j--) {
if('Keyboard_'+arguments[i] == this.keyboards[j]['KI']) {
this.keyboards.splice(j, 1);
break;
}
}
}
if(activeRemoved) {
if(this.keyboardStubs.length > 0) {

View file

@ -303,10 +303,11 @@ namespace com.keyman {
/**
* Build 362: removeKeyboards() remove keyboard from list of available keyboards
*
* @param {string} x keyboard name string
* @param {string} x keyboard name string
* @param {boolean} force When true, also drops the cached keyboard object
*
*/
['removeKeyboards'](x) {
['removeKeyboards'](x, force?) {
return this.keyboardManager.removeKeyboards(x);
}