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

корректировка copy/paste для chrome mac

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@50517 954022d7-b5bf-4e40-9824-e11837661b57
parent 1eee3ee9
...@@ -761,6 +761,7 @@ ...@@ -761,6 +761,7 @@
_editorPaste: function (worksheet,callback) { _editorPaste: function (worksheet,callback) {
var t = this; var t = this;
window.GlobalPasteFlagCounter = 1; window.GlobalPasteFlagCounter = 1;
isTruePaste = false;
var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1; var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
document.body.style.MozUserSelect = "text"; document.body.style.MozUserSelect = "text";
delete document.body.style["-khtml-user-select"]; delete document.body.style["-khtml-user-select"];
...@@ -817,9 +818,7 @@ ...@@ -817,9 +818,7 @@
} }
}*/ }*/
if(!is_chrome) if(!isTruePaste)
t._editorPasteExec(worksheet, pastebin);
else if(is_chrome && !isTruePaste)
t._editorPasteExec(worksheet, pastebin); t._editorPasteExec(worksheet, pastebin);
pastebin.style.display = ELEMENT_DISPAY_STYLE; pastebin.style.display = ELEMENT_DISPAY_STYLE;
...@@ -1026,7 +1025,7 @@ ...@@ -1026,7 +1025,7 @@
} }
if(null != sHtml) if(null != sHtml)
{ {
t._addHtmlToIframe(worksheet,sHtml,isText); t._addHtmlToIframe(worksheet,sHtml,isText,e);
} }
else else
{ {
...@@ -1054,9 +1053,10 @@ ...@@ -1054,9 +1053,10 @@
} }
}, },
_addHtmlToIframe: function(worksheet,sHtml,isText) _addHtmlToIframe: function(worksheet,sHtml,isText,e)
{ {
var t = this; var t = this;
var bExist = false;
//Записываем html в IFrame //Записываем html в IFrame
var ifr = document.getElementById("pasteFrame"); var ifr = document.getElementById("pasteFrame");
if (!ifr) if (!ifr)
...@@ -1081,15 +1081,23 @@ ...@@ -1081,15 +1081,23 @@
frameWindow.document.write(sHtml); frameWindow.document.write(sHtml);
frameWindow.document.close(); frameWindow.document.close();
var bodyFrame = frameWindow.document.body; var bodyFrame = frameWindow.document.body;
isTruePaste = false;
if(bodyFrame && bodyFrame != null) if(bodyFrame && bodyFrame != null)
{ {
t._editorPasteExec(worksheet, frameWindow.document.body,isText); t._editorPasteExec(worksheet, frameWindow.document.body,isText);
isTruePaste = true;
}
bExist = true; bExist = true;
} }
ifr.style.display = ELEMENT_DISPAY_STYLE; ifr.style.display = ELEMENT_DISPAY_STYLE;
}
if(bExist)
{
isTruePaste = true;
if (e.preventDefault)
{
e.stopPropagation();
e.preventDefault();
}
return false;
}
}, },
_copyPasteCorrectString: function (str) _copyPasteCorrectString: function (str)
{ {
......
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