Commit ec9bec9d authored by Oleg.Korshul's avatar Oleg.Korshul Committed by Alexander.Trofimov

drag&drop images (local editor)

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@66814 954022d7-b5bf-4e40-9824-e11837661b57
parent 8befa06a
......@@ -174,6 +174,28 @@ window["NativeCorrectImageUrlOnPaste"] = function(url)
return window["AscDesktopEditor"]["LocalFileGetImageUrl"](url);
};
function InitDragAndDrop(oHtmlElement, callback) {
if ("undefined" != typeof(FileReader) && null != oHtmlElement) {
oHtmlElement["ondragover"] = function (e) {
e.preventDefault();
e.dataTransfer.dropEffect = CanDropFiles(e) ? 'copy' : 'none';
return false;
};
oHtmlElement["ondrop"] = function (e) {
e.preventDefault();
var _files = window["AscDesktopEditor"]["GetDropFiles"]();
for (var i = 0; i < _files.length; i++)
{
if (window["AscDesktopEditor"]["IsImageFile"](_files[i]))
{
window["DesktopOfflineAppDocumentAddImageEnd"](_files[i]);
}
}
};
}
}
// меняем среду
AscBrowser.isSafari = false;
AscBrowser.isSafariMacOs = false;
......
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