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

asc_enableKeyEvents

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