Fixes issues with UI focus handling that interfered with control-by-control handling of languages.

Also fixes issues with the Toggle UI displaying for API-disabled controls.
This commit is contained in:
Joshua Horton 2017-06-14 10:34:39 +07:00
parent 69a58ebea7
commit 2e30d8232b
2 changed files with 22 additions and 5 deletions

View file

@ -2105,7 +2105,7 @@
* @return {boolean} always true (?)
*/
keymanweb._ControlFocus = function(e)
{
{
var Ltarg, Ln;
if(!keymanweb._Enabled) return true;
e = keymanweb._GetEventObject(e); // I2404 - Manage IE events in IFRAMEs
@ -2161,7 +2161,7 @@
else
keymanweb._ActiveControl.LDefaultInternalName = keymanweb._ActiveKeyboard == null ? '' : keymanweb._ActiveKeyboard['KI'];
}
//TODO: the logic of the following line doesn't look right!! Both variables are true, but that doesn't make sense!
//_Debug(keymanweb._IsIEEditableIframe(Ltarg,1) + '...' +keymanweb._IsMozillaEditableIframe(Ltarg,1));
if(!keymanweb._IsIEEditableIframe(Ltarg,1) || !keymanweb._IsMozillaEditableIframe(Ltarg,1))
@ -2289,13 +2289,19 @@
////keymanweb._SelectionControl = null;
keymanweb._LastActiveElement = Ltarg;
if(keymanweb._ActiveControl != null && keymanweb._ActiveControl.LDefaultInternalName != null)
if(keymanweb._ActiveKeyboard == null)
keymanweb._ActiveControl.LDefaultInternalName = '';
else
keymanweb._ActiveControl.LDefaultInternalName = keymanweb._ActiveKeyboard['KI'];
/* If the KeymanWeb UI is active as a user changes controls, all UI-based effects should be restrained to this control in case
* the user is manually specifying languages on a per-control basis.
*/
keymanweb._JustActivatedKeymanWebUI = 0;
keymanweb._ActiveControl = null;
if(!keymanweb._IsActivatingKeymanWebUI) keymanweb._NotifyKeyboard(0,Ltarg,0); // I2187

View file

@ -52,9 +52,20 @@ try {
ui.doFocus = function(someElement,focusing)
{
// This callback must be ignored until UI is initialized, or for touch devices (which can never initialize the UI)
if(!ui.initialized) return;
if(!ui.initialized) {
return;
}
if(window.event) someElement=window.event.srcElement;
if(window.event) {
someElement=window.event.srcElement;
}
// Hides the Toggle interface if a control has KeymanWeb disabled by API calls.
if(keymanweb._ActiveControl != null){
if(!keymanweb._ActiveControl.LEnabled) {
focusing = false;
}
}
if(focusing)
{