From 72bdc8d2de4f9872d33a88db50d62a231a7ca7f8 Mon Sep 17 00:00:00 2001 From: "Joshua A. Horton" Date: Thu, 7 Mar 2019 09:31:34 +0700 Subject: [PATCH] Fixes #1638. --- web/source/kmwapi.ts | 11 ++++++----- web/source/kmwutils.ts | 4 ++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/web/source/kmwapi.ts b/web/source/kmwapi.ts index 5fd8dd170a..b217dccc89 100644 --- a/web/source/kmwapi.ts +++ b/web/source/kmwapi.ts @@ -12,13 +12,14 @@ (function() { let prototype = com.keyman.Util.prototype; - var publishAPI = function(miniName: string, longName: string) { - prototype[miniName] = prototype[longName]; + var publishAPI = function(legacyName: string, name: string) { + prototype[legacyName] = prototype[name]; } - publishAPI('getAbsoluteX', "_GetAbsoluteX"); - publishAPI("getAbsoluteY", "_GetAbsoluteY"); - publishAPI("getAbsolute", "_GetAbsolute"); + // These four were renamed, but we need to maintain their legacy names. + publishAPI("_GetAbsoluteX", 'getAbsoluteX'); + publishAPI("_GetAbsoluteY", "getAbsoluteY"); + publishAPI("_GetAbsolute", "getAbsolute"); publishAPI("toNzString", "nzString"); }()); diff --git a/web/source/kmwutils.ts b/web/source/kmwutils.ts index 91b539689c..0bfd8a1ed6 100644 --- a/web/source/kmwutils.ts +++ b/web/source/kmwutils.ts @@ -281,7 +281,7 @@ namespace com.keyman { * @return {Object.} * Description Returns absolute position of Pobj element with respect to page */ - _GetAbsolute(Pobj: HTMLElement) { + getAbsolute(Pobj: HTMLElement) { var p={ /* @ export */ x: this.getAbsoluteX(Pobj), @@ -292,7 +292,7 @@ namespace com.keyman { } // Unofficial API used by our desktop UIs. - getAbsolute = this._GetAbsolute; + _GetAbsolute = this.getAbsolute; /** * Select start handler (to replace multiple inline handlers) (Build 360)