Commit 385af23a authored by Oleg Korshul's avatar Oleg Korshul

ie emulate keydown

parent 38ebc2c1
......@@ -121,6 +121,7 @@
this.IsUseFirstTextInputAfterComposition = false;
this.nativeFocusElement = null;
this.nativeFocusElementNoRemoveOnElementFocus = false;
this.InterfaceEnableKeyEvents = true;
this.ieNonCompositionPrefix = "";
......@@ -1215,10 +1216,14 @@
document.addEventListener("focus", function(e)
{
var t = window['AscCommon'].g_inputContext;
var _oldNativeFE = t.nativeFocusElement;
t.nativeFocusElement = e.target;
//console.log(t.nativeFocusElement);
var _nativeFocusElementNoRemoveOnElementFocus = t.nativeFocusElementNoRemoveOnElementFocus;
t.nativeFocusElementNoRemoveOnElementFocus = false;
if (t.InterfaceEnableKeyEvents == false)
{
t.nativeFocusElement = null;
......@@ -1228,7 +1233,12 @@
if (t.nativeFocusElement.id == t.HtmlArea.id)
{
t.Api.asc_enableKeyEvents(true, true);
t.nativeFocusElement = null;
if (_nativeFocusElementNoRemoveOnElementFocus)
t.nativeFocusElement = _oldNativeFE;
else
t.nativeFocusElement = null;
return;
}
if (t.nativeFocusElement.id == window['AscCommon'].g_clipboardBase.CommonDivId)
......@@ -1237,6 +1247,8 @@
return;
}
t.nativeFocusElementNoRemoveOnElementFocus = false;
var _isElementEditable = false;
if (true)
{
......@@ -1293,6 +1305,7 @@
t.nativeFocusElement = null;
var _elem = t.nativeFocusElement;
t.nativeFocusElementNoRemoveOnElementFocus = true; // ie focus async
t.HtmlArea.focus();
t.nativeFocusElement = _elem;
t.Api.asc_enableKeyEvents(true, true);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment