Commit 5f60818c authored by Oleg Korshul's avatar Oleg Korshul Committed by GitHub

Merge pull request #64 from ONLYOFFICE/hotfix/v4.1.2

Hotfix/v4.1.2
parents 25abe29f 24a94386
...@@ -2491,7 +2491,7 @@ DrawingObjectsController.prototype = ...@@ -2491,7 +2491,7 @@ DrawingObjectsController.prototype =
checkObjectInArray(aGroups, objects_by_type.oleObjects[i].group.getMainGroup()); checkObjectInArray(aGroups, objects_by_type.oleObjects[i].group.getMainGroup());
} }
var api = window.editor || window.Asc.editor; var api = window.editor || window["Asc"]["editor"];
if(api) if(api)
{ {
var pluginData = new Asc.CPluginData(); var pluginData = new Asc.CPluginData();
......
...@@ -879,7 +879,7 @@ function ResizeTrackShapeImage(originalObject, cardDirection) ...@@ -879,7 +879,7 @@ function ResizeTrackShapeImage(originalObject, cardDirection)
} }
if(this.originalObject.getObjectType && this.originalObject.getObjectType() === AscDFH.historyitem_type_OleObject) if(this.originalObject.getObjectType && this.originalObject.getObjectType() === AscDFH.historyitem_type_OleObject)
{ {
var api = window.editor || window.Asc.editor; var api = window.editor || window["Asc"]["editor"];
if(api) if(api)
{ {
var pluginData = new Asc.CPluginData(); var pluginData = new Asc.CPluginData();
......
...@@ -778,18 +778,25 @@ ...@@ -778,18 +778,25 @@
baseEditorsApi.prototype.asc_checkImageUrlAndAction = function(sImageUrl, fCallback) baseEditorsApi.prototype.asc_checkImageUrlAndAction = function(sImageUrl, fCallback)
{ {
var oThis = this;
this.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.UploadImage);
var fCallback2 = function()
{
oThis.sync_EndAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.UploadImage);
fCallback.apply(oThis, arguments);
};
var sLocalImage = AscCommon.g_oDocumentUrls.getImageLocal(sImageUrl); var sLocalImage = AscCommon.g_oDocumentUrls.getImageLocal(sImageUrl);
if (sLocalImage) if (sLocalImage)
{ {
this.asc_loadLocalImageAndAction(sLocalImage, fCallback); this.asc_loadLocalImageAndAction(sLocalImage, fCallback2);
return; return;
} }
var oThis = this;
AscCommon.sendImgUrls(oThis, [sImageUrl], function(data) AscCommon.sendImgUrls(oThis, [sImageUrl], function(data)
{ {
if (data[0] && data[0].path != null) if (data[0] && data[0].path != null)
{ {
oThis.asc_loadLocalImageAndAction(AscCommon.g_oDocumentUrls.imagePath2Local(data[0].path), fCallback); oThis.asc_loadLocalImageAndAction(AscCommon.g_oDocumentUrls.imagePath2Local(data[0].path), fCallback2);
} }
}, this.editorId === c_oEditorId.Spreadsheet); }, this.editorId === c_oEditorId.Spreadsheet);
}; };
...@@ -810,6 +817,7 @@ ...@@ -810,6 +817,7 @@
&& AscFormat.isRealNumber(nWidthPix) && AscFormat.isRealNumber(nHeightPix) && AscFormat.isRealNumber(nWidthPix) && AscFormat.isRealNumber(nHeightPix)
&& AscFormat.isRealNumber(fWidth) && AscFormat.isRealNumber(fHeight) && AscFormat.isRealNumber(fWidth) && AscFormat.isRealNumber(fHeight)
) )
this.asc_checkImageUrlAndAction(sImgSrc, function(oImage) this.asc_checkImageUrlAndAction(sImgSrc, function(oImage)
{ {
oThis.asc_addOleObjectAction(AscCommon.g_oDocumentUrls.getImageLocal(oImage.src), sData, sGuid, fWidth, fHeight, nWidthPix, nHeightPix); oThis.asc_addOleObjectAction(AscCommon.g_oDocumentUrls.getImageLocal(oImage.src), sData, sGuid, fWidth, fHeight, nWidthPix, nHeightPix);
......
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