Commit 4c9e7857 authored by Oleg Korshul's avatar Oleg Korshul Committed by GitHub

Merge pull request #79 from ONLYOFFICE/hotfix/v4.1.5

Hotfix/v4.1.5
parents 75a521cc cef6dfae
...@@ -456,7 +456,7 @@ var editor; ...@@ -456,7 +456,7 @@ var editor;
spreadsheet_api.prototype.asc_Copy = function() { spreadsheet_api.prototype.asc_Copy = function() {
if (window["AscDesktopEditor"]) if (window["AscDesktopEditor"])
{ {
window["AscDesktopEditor"]["Copy"](); window["asc_desktop_copypaste"](this, "Copy");
return true; return true;
} }
return AscCommon.g_clipboardBase.Button_Copy(); return AscCommon.g_clipboardBase.Button_Copy();
...@@ -465,7 +465,7 @@ var editor; ...@@ -465,7 +465,7 @@ var editor;
spreadsheet_api.prototype.asc_Paste = function() { spreadsheet_api.prototype.asc_Paste = function() {
if (window["AscDesktopEditor"]) if (window["AscDesktopEditor"])
{ {
window["AscDesktopEditor"]["Paste"](); window["asc_desktop_copypaste"](this, "Paste");
return true; return true;
} }
if (!AscCommon.g_clipboardBase.IsWorking()) { if (!AscCommon.g_clipboardBase.IsWorking()) {
...@@ -477,7 +477,7 @@ var editor; ...@@ -477,7 +477,7 @@ var editor;
spreadsheet_api.prototype.asc_Cut = function() { spreadsheet_api.prototype.asc_Cut = function() {
if (window["AscDesktopEditor"]) if (window["AscDesktopEditor"])
{ {
window["AscDesktopEditor"]["Cut"](); window["asc_desktop_copypaste"](this, "Cut");
return true; return true;
} }
return AscCommon.g_clipboardBase.Button_Cut(); return AscCommon.g_clipboardBase.Button_Cut();
......
...@@ -2021,7 +2021,7 @@ ...@@ -2021,7 +2021,7 @@
if (this.HtmlPage.m_oApi.isMobileVersion) if (this.HtmlPage.m_oApi.isMobileVersion)
{ {
var _w = this.HtmlPage.m_oEditor.HtmlElement.width; var _w = this.HtmlPage.m_oEditor.HtmlElement.width;
if (this.bIsRetinaSupport) if (this.HtmlPage.bIsRetinaSupport)
{ {
_w >>= 1; _w >>= 1;
} }
......
...@@ -233,6 +233,17 @@ window["asc_initAdvancedOptions"] = function(_code) ...@@ -233,6 +233,17 @@ window["asc_initAdvancedOptions"] = function(_code)
_editor._onNeedParams(undefined, (_code == 90 || _code == 91) ? true : undefined); _editor._onNeedParams(undefined, (_code == 90 || _code == 91) ? true : undefined);
}; };
// copy/paste focus error!!!
window["asc_desktop_copypaste"] = function(_api, _method)
{
var bIsFocus = _api.asc_IsFocus();
if (!bIsFocus)
_api.asc_enableKeyEvents(true);
window["AscDesktopEditor"][_method]();
if (!bIsFocus)
_api.asc_enableKeyEvents(false);
}
// меняем среду // меняем среду
//AscBrowser.isSafari = false; //AscBrowser.isSafari = false;
//AscBrowser.isSafariMacOs = false; //AscBrowser.isSafariMacOs = false;
......
...@@ -785,7 +785,7 @@ ...@@ -785,7 +785,7 @@
{ {
var _loadedUrl = this.ImageLoader.LoadImage(AscCommon.getFullImageSrc2(sLocalImage), 1); var _loadedUrl = this.ImageLoader.LoadImage(AscCommon.getFullImageSrc2(sLocalImage), 1);
if (_loadedUrl != null) if (_loadedUrl != null)
fCallback(); fCallback(_loadedUrl);
else else
this.asc_replaceLoadImageCallback(fCallback); this.asc_replaceLoadImageCallback(fCallback);
}; };
......
...@@ -160,6 +160,8 @@ ...@@ -160,6 +160,8 @@
// еще один режим для ie & edge // еще один режим для ie & edge
this.IsUseInputEventOnlyWithCtx = (AscCommon.AscBrowser.isIE) ? true : false; this.IsUseInputEventOnlyWithCtx = (AscCommon.AscBrowser.isIE) ? true : false;
this.IsInitialInputContext = false; this.IsInitialInputContext = false;
this.IsDisableKeyPress = false;
} }
CTextInput.prototype = CTextInput.prototype =
...@@ -234,14 +236,32 @@ ...@@ -234,14 +236,32 @@
var oThis = this; var oThis = this;
this.HtmlArea["onkeydown"] = function(e) this.HtmlArea["onkeydown"] = function(e)
{ {
if (AscCommon.AscBrowser.isSafariMacOs)
{
var cmdButton = (e.ctrlKey || e.metaKey) ? true : false;
var buttonCode = ((e.keyCode == 67) || (e.keyCode == 88) || (e.keyCode == 86));
if (cmdButton && buttonCode)
oThis.IsDisableKeyPress = true;
else
oThis.IsDisableKeyPress = false;
}
return oThis.onKeyDown(e); return oThis.onKeyDown(e);
}; };
this.HtmlArea["onkeypress"] = function(e) this.HtmlArea["onkeypress"] = function(e)
{ {
if (oThis.IsDisableKeyPress == true)
{
// macOS Sierra send keypress before copy event
oThis.IsDisableKeyPress = false;
var cmdButton = (e.ctrlKey || e.metaKey) ? true : false;
if (cmdButton)
return;
}
return oThis.onKeyPress(e); return oThis.onKeyPress(e);
}; };
this.HtmlArea["onkeyup"] = function(e) this.HtmlArea["onkeyup"] = function(e)
{ {
oThis.IsDisableKeyPress = false;
return oThis.onKeyUp(e); return oThis.onKeyUp(e);
}; };
......
...@@ -1826,7 +1826,7 @@ background-repeat: no-repeat;\ ...@@ -1826,7 +1826,7 @@ background-repeat: no-repeat;\
{ {
if (window["AscDesktopEditor"]) if (window["AscDesktopEditor"])
{ {
window["AscDesktopEditor"]["Copy"](); window["asc_desktop_copypaste"](this, "Copy");
return true; return true;
} }
return AscCommon.g_clipboardBase.Button_Copy(); return AscCommon.g_clipboardBase.Button_Copy();
...@@ -1839,7 +1839,7 @@ background-repeat: no-repeat;\ ...@@ -1839,7 +1839,7 @@ background-repeat: no-repeat;\
{ {
if (window["AscDesktopEditor"]) if (window["AscDesktopEditor"])
{ {
window["AscDesktopEditor"]["Cut"](); window["asc_desktop_copypaste"](this, "Cut");
return true; return true;
} }
return AscCommon.g_clipboardBase.Button_Cut(); return AscCommon.g_clipboardBase.Button_Cut();
...@@ -1848,7 +1848,7 @@ background-repeat: no-repeat;\ ...@@ -1848,7 +1848,7 @@ background-repeat: no-repeat;\
{ {
if (window["AscDesktopEditor"]) if (window["AscDesktopEditor"])
{ {
window["AscDesktopEditor"]["Paste"](); window["asc_desktop_copypaste"](this, "Paste");
return true; return true;
} }
......
...@@ -1901,7 +1901,7 @@ background-repeat: no-repeat;\ ...@@ -1901,7 +1901,7 @@ background-repeat: no-repeat;\
{ {
if (window["AscDesktopEditor"]) if (window["AscDesktopEditor"])
{ {
window["AscDesktopEditor"]["Copy"](); window["asc_desktop_copypaste"](this, "Copy");
return true; return true;
} }
return AscCommon.g_clipboardBase.Button_Copy(); return AscCommon.g_clipboardBase.Button_Copy();
...@@ -1914,7 +1914,7 @@ background-repeat: no-repeat;\ ...@@ -1914,7 +1914,7 @@ background-repeat: no-repeat;\
{ {
if (window["AscDesktopEditor"]) if (window["AscDesktopEditor"])
{ {
window["AscDesktopEditor"]["Cut"](); window["asc_desktop_copypaste"](this, "Cut");
return true; return true;
} }
return AscCommon.g_clipboardBase.Button_Cut(); return AscCommon.g_clipboardBase.Button_Cut();
...@@ -1923,7 +1923,7 @@ background-repeat: no-repeat;\ ...@@ -1923,7 +1923,7 @@ background-repeat: no-repeat;\
{ {
if (window["AscDesktopEditor"]) if (window["AscDesktopEditor"])
{ {
window["AscDesktopEditor"]["Paste"](); window["asc_desktop_copypaste"](this, "Paste");
return true; return true;
} }
if (!this.WordControl.m_oLogicDocument) if (!this.WordControl.m_oLogicDocument)
......
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