Commit 016d7315 authored by Oleg Korshul's avatar Oleg Korshul

asc_enableKeyEvents

parent 8adc73a1
......@@ -1961,7 +1961,7 @@ var editor;
this.wb.changeZoom(scale);
};
spreadsheet_api.prototype.asc_enableKeyEvents = function(isEnabled) {
spreadsheet_api.prototype.asc_enableKeyEvents = function(isEnabled, isFromInput) {
if (!this.isLoadFullApi) {
this.tmpFocus = isEnabled;
return;
......@@ -1972,6 +1972,9 @@ var editor;
}
//наличие фокуса в рабочей области редактора(используется для copy/paste в MAC)
this.IsFocus = isEnabled;
if (isFromInput !== true && AscCommon.g_inputContext)
AscCommon.g_inputContext.InterfaceEnableKeyEvents = isEnabled;
};
spreadsheet_api.prototype.asc_IsFocus = function(bIsNaturalFocus) {
......
......@@ -249,7 +249,7 @@
window["AscDesktopEditor"]["SetDocumentName"](this.documentTitle);
}
};
baseEditorsApi.prototype.asc_enableKeyEvents = function(isEnabled)
baseEditorsApi.prototype.asc_enableKeyEvents = function(isEnabled, isFromInput)
{
};
// Copy/Past/Cut
......@@ -310,9 +310,6 @@
{
this.sendEvent("asc_OnTryUndoInFastCollaborative");
};
baseEditorsApi.prototype.asc_enableKeyEvents = function(val)
{
};
baseEditorsApi.prototype.asc_setViewMode = function()
{
};
......
......@@ -77,6 +77,7 @@
this.IsUseFirstTextInputAfterComposition = false;
this.nativeFocusElement = null;
this.InterfaceEnableKeyEvents = true;
}
CTextInput.prototype =
......@@ -589,9 +590,15 @@
//console.log(t.nativeFocusElement);
if (t.InterfaceEnableKeyEvents == false)
{
t.nativeFocusElement = null;
return;
}
if (t.nativeFocusElement.id == t.HtmlArea.id)
{
t.Api.asc_enableKeyEvents(true);
t.Api.asc_enableKeyEvents(true, true);
t.nativeFocusElement = null;
return;
}
......@@ -620,7 +627,7 @@
if ("IFRAME" == _name)
{
// перехват клавиатуры
t.Api.asc_enableKeyEvents(false);
t.Api.asc_enableKeyEvents(false, true);
t.nativeFocusElement = null;
return;
}
......@@ -639,7 +646,7 @@
if (_oo_editor_input == "true")
{
// перехват клавиатуры
t.Api.asc_enableKeyEvents(false);
t.Api.asc_enableKeyEvents(false, true);
t.nativeFocusElement = null;
return;
}
......@@ -647,7 +654,7 @@
if (_isElementEditable && (_oo_editor_input != "false"))
{
// перехват клавиатуры
t.Api.asc_enableKeyEvents(false);
t.Api.asc_enableKeyEvents(false, true);
t.nativeFocusElement = null;
return;
}
......@@ -659,7 +666,7 @@
var _elem = t.nativeFocusElement;
t.HtmlArea.focus();
t.nativeFocusElement = _elem;
t.Api.asc_enableKeyEvents(true);
t.Api.asc_enableKeyEvents(true, true);
}, true);
......
......@@ -4238,7 +4238,7 @@ background-repeat: no-repeat;\
};
/*----------------------------------------------------------------*/
asc_docs_api.prototype.asc_enableKeyEvents = function(value)
asc_docs_api.prototype.asc_enableKeyEvents = function(value, isFromInput)
{
if (!this.isLoadFullApi)
{
......@@ -4251,6 +4251,9 @@ background-repeat: no-repeat;\
this.WordControl.IsFocus = value;
this.asc_fireCallback("asc_onEnableKeyEventsChanged", value);
}
if (isFromInput !== true && AscCommon.g_inputContext)
AscCommon.g_inputContext.InterfaceEnableKeyEvents = value;
};
......
......@@ -6256,7 +6256,7 @@ background-repeat: no-repeat;\
};
/*----------------------------------------------------------------*/
asc_docs_api.prototype.asc_enableKeyEvents = function(value)
asc_docs_api.prototype.asc_enableKeyEvents = function(value, isFromInput)
{
if (!this.isLoadFullApi)
{
......@@ -6273,6 +6273,9 @@ background-repeat: no-repeat;\
this.asc_fireCallback("asc_onEnableKeyEventsChanged", value);
}
if (isFromInput !== true && AscCommon.g_inputContext)
AscCommon.g_inputContext.InterfaceEnableKeyEvents = value;
};
asc_docs_api.prototype.asc_IsFocus = function(bIsNaturalFocus)
{
......
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