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;
spreadsheet_api.prototype.asc_Copy = function() {
if (window["AscDesktopEditor"])
{
window["AscDesktopEditor"]["Copy"]();
window["asc_desktop_copypaste"](this, "Copy");
return true;
}
return AscCommon.g_clipboardBase.Button_Copy();
......@@ -465,7 +465,7 @@ var editor;
spreadsheet_api.prototype.asc_Paste = function() {
if (window["AscDesktopEditor"])
{
window["AscDesktopEditor"]["Paste"]();
window["asc_desktop_copypaste"](this, "Paste");
return true;
}
if (!AscCommon.g_clipboardBase.IsWorking()) {
......@@ -477,7 +477,7 @@ var editor;
spreadsheet_api.prototype.asc_Cut = function() {
if (window["AscDesktopEditor"])
{
window["AscDesktopEditor"]["Cut"]();
window["asc_desktop_copypaste"](this, "Cut");
return true;
}
return AscCommon.g_clipboardBase.Button_Cut();
......
......@@ -2021,7 +2021,7 @@
if (this.HtmlPage.m_oApi.isMobileVersion)
{
var _w = this.HtmlPage.m_oEditor.HtmlElement.width;
if (this.bIsRetinaSupport)
if (this.HtmlPage.bIsRetinaSupport)
{
_w >>= 1;
}
......
......@@ -233,6 +233,17 @@ window["asc_initAdvancedOptions"] = function(_code)
_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.isSafariMacOs = false;
......
......@@ -785,7 +785,7 @@
{
var _loadedUrl = this.ImageLoader.LoadImage(AscCommon.getFullImageSrc2(sLocalImage), 1);
if (_loadedUrl != null)
fCallback();
fCallback(_loadedUrl);
else
this.asc_replaceLoadImageCallback(fCallback);
};
......
......@@ -160,6 +160,8 @@
// еще один режим для ie & edge
this.IsUseInputEventOnlyWithCtx = (AscCommon.AscBrowser.isIE) ? true : false;
this.IsInitialInputContext = false;
this.IsDisableKeyPress = false;
}
CTextInput.prototype =
......@@ -234,14 +236,32 @@
var oThis = this;
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);
};
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);
};
this.HtmlArea["onkeyup"] = function(e)
{
oThis.IsDisableKeyPress = false;
return oThis.onKeyUp(e);
};
......
......@@ -1826,7 +1826,7 @@ background-repeat: no-repeat;\
{
if (window["AscDesktopEditor"])
{
window["AscDesktopEditor"]["Copy"]();
window["asc_desktop_copypaste"](this, "Copy");
return true;
}
return AscCommon.g_clipboardBase.Button_Copy();
......@@ -1839,7 +1839,7 @@ background-repeat: no-repeat;\
{
if (window["AscDesktopEditor"])
{
window["AscDesktopEditor"]["Cut"]();
window["asc_desktop_copypaste"](this, "Cut");
return true;
}
return AscCommon.g_clipboardBase.Button_Cut();
......@@ -1848,7 +1848,7 @@ background-repeat: no-repeat;\
{
if (window["AscDesktopEditor"])
{
window["AscDesktopEditor"]["Paste"]();
window["asc_desktop_copypaste"](this, "Paste");
return true;
}
......
......@@ -1901,7 +1901,7 @@ background-repeat: no-repeat;\
{
if (window["AscDesktopEditor"])
{
window["AscDesktopEditor"]["Copy"]();
window["asc_desktop_copypaste"](this, "Copy");
return true;
}
return AscCommon.g_clipboardBase.Button_Copy();
......@@ -1914,7 +1914,7 @@ background-repeat: no-repeat;\
{
if (window["AscDesktopEditor"])
{
window["AscDesktopEditor"]["Cut"]();
window["asc_desktop_copypaste"](this, "Cut");
return true;
}
return AscCommon.g_clipboardBase.Button_Cut();
......@@ -1923,7 +1923,7 @@ background-repeat: no-repeat;\
{
if (window["AscDesktopEditor"])
{
window["AscDesktopEditor"]["Paste"]();
window["asc_desktop_copypaste"](this, "Paste");
return true;
}
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