mirror of
https://github.com/keymanapp/keyman.git
synced 2026-09-06 23:57:40 +00:00
feat(web): Adds 'force' parameter to removeKeyboards for unit test use
This commit is contained in:
parent
a79b4dfa5e
commit
39eb9bfabc
2 changed files with 14 additions and 4 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue