change(web): OSK cookie notes KMW version

This commit is contained in:
jahorton 2021-09-14 12:55:34 +07:00
parent 39262d978b
commit 9a205474cc

View file

@ -515,6 +515,7 @@ namespace com.keyman.osk {
c['userSet'] = this.userPositioned ? 1 : 0;
c['left'] = p.left;
c['top'] = p.top;
c['_version'] = utils.Version.CURRENT.toString();
if(this.vkbd) {
c['width'] = this.width.val;
@ -538,6 +539,7 @@ namespace com.keyman.osk {
this.userPositioned = util.toNumber(c['userSet'], 0) == 1;
this.x = util.toNumber(c['left'],-1);
this.y = util.toNumber(c['top'],-1);
let cookieVersionString = c['_version'];
// Restore OSK size - font size now fixed in relation to OSK height, unless overridden (in em) by keyboard
let dfltWidth=0.3*screen.width;
@ -563,7 +565,10 @@ namespace com.keyman.osk {
newHeight=0.5*screen.height;
}
if(isNewCookie) {
// if(!cookieVersionString) - this component was not tracked until 15.0.
// Before that point, the OSK's title bar and resize bar heights were not included
// in the OSK's cookie-persisted height.
if(isNewCookie || !cookieVersionString) {
// Adds some space to account for the OSK's header and footer, should they exist.
if(this.headerView && this.headerView.layoutHeight.absolute) {
newHeight += this.headerView.layoutHeight.val;