fix(web): Simplify initialization of options

This commit is contained in:
Darcy Wong 2021-06-24 11:50:03 +07:00
parent 36acc16927
commit e5e1ccff4e
2 changed files with 4 additions and 7 deletions

View file

@ -30,7 +30,7 @@ if(!window['keyman']['initialized']) {
*/
keymanweb.setDefaultDeviceOptions = function(opt : com.keyman.OptionType) {
// Element attachment type
if (opt['attachType'] == '' || opt['attachType'] === undefined) {
if (!opt['attachType']) {
opt['attachType'] = (device.touchable ? 'manual' : 'auto');
}
}

View file

@ -41,12 +41,9 @@
var attachText = attachType ? attachType : "default";
var kmw=window.keyman;
if (attachType) {
kmw.init({
attachType: attachType});
} else {
kmw.init({});
}
kmw.init({
attachType: attachType ? attachType : ''
});
</script>
<!-- Add keyboard management script for local selection of keyboards to use -->