Commit 25f0f260 authored by Igor.Zotov's avatar Igor.Zotov Committed by Alexander.Trofimov

+ copy/paste MAC

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@48425 954022d7-b5bf-4e40-9824-e11837661b57
parent f9b723eb
......@@ -1851,6 +1851,8 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
asc_enableKeyEvents: function (isEnabled) {
if (this.wb)
this.wb.enableKeyEventsHandler(isEnabled);
//находится ли фокус в рабочей поверхности редактора(используется для copy/paste в MAC)
this.IsFocus = isEnabled;
},
asc_findText: function (text, scanByRows, scanForward, isMatchCase, isWholeCell) {
......
......@@ -2567,15 +2567,15 @@ function SafariIntervalFocus()
var api = window["Asc"]["editor"];
if (api)
{
if(api.wb && api.wb.cellEditor && api.wb.cellEditor != null && api.wb.cellEditor.isTopLineActive)
if((api.wb && api.wb.cellEditor && api.wb.cellEditor != null && api.wb.cellEditor.isTopLineActive) || (api.wb && api.wb.getWorksheet() && api.wb.getWorksheet().isSelectionDialogMode))
return;
var pastebin = document.getElementById(COPY_ELEMENT_ID);
var pastebinText = document.getElementById(kElementTextId);
if(pastebinText && (api.wb && api.wb.getWorksheet() && api.wb.getWorksheet().isCellEditMode))
if(pastebinText && (api.wb && api.wb.getWorksheet() && api.wb.getWorksheet().isCellEditMode) && api.IsFocus)
{
pastebinText.focus();
}
else if (pastebin)
else if (pastebin && api.IsFocus)
pastebin.focus();
else
{
......@@ -2604,17 +2604,6 @@ function Editor_CopyPaste_Create(api)
ElemToSelect.style["-webkit-user-select"] = "text";
ElemToSelect.setAttribute("contentEditable", true);
/* var Def_rPr = api.WordControl.m_oLogicDocument.Styles.Default.TextPr;
ElemToSelect.style.fontFamily = Def_rPr.FontFamily.Name;
if (!api.DocumentReaderMode)
ElemToSelect.style.fontSize = Def_rPr.FontSize + "pt";
else
{
api.DocumentReaderMode.CorrectDefaultFontSize(Def_rPr.FontSize);
ElemToSelect.style.fontSize = "1em";
}*/
ElemToSelect.style.lineHeight = "1px";
ElemToSelect["onpaste"] = function(e){
......@@ -2625,6 +2614,10 @@ function Editor_CopyPaste_Create(api)
api.wb.clipboard.copyRange(api.wb.getWorksheet().getSelectedRange(), api.wb.getWorksheet());
};
/*ElemToSelect["onbeforecut"] = function(e){
api.wb.clipboard.copyRange(api.wb.getWorksheet().getSelectedRange(), api.wb.getWorksheet());
};*/
document.body.appendChild( ElemToSelect );
//для редактора ячейки
......@@ -2650,6 +2643,14 @@ function Editor_CopyPaste_Create(api)
}
};
/*elementText["onbeforecut"] = function(e){
if((api.wb && api.wb.getWorksheet() && api.wb.getWorksheet().isCellEditMode))
{
v = api.wb.cellEditor.copySelection();
if (v) {api.wb.clipboard.copyCellValue(v, api.wb.cellEditor.hasBackground ? api.wb.cellEditor.background : null);}
}
};*/
/*elementText["onpaste"] = function(e){
api.wb.clipboard.pasteAsText();
};*/
......
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