Commit 434f26f2 authored by Sergey Luzyanin's avatar Sergey Luzyanin

sync_StartAction & sync_EndAction

parent f4552010
......@@ -778,18 +778,25 @@
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);
if (sLocalImage)
{
this.asc_loadLocalImageAndAction(sLocalImage, fCallback);
this.asc_loadLocalImageAndAction(sLocalImage, fCallback2);
return;
}
var oThis = this;
AscCommon.sendImgUrls(oThis, [sImageUrl], function(data)
{
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);
};
......@@ -810,6 +817,7 @@
&& AscFormat.isRealNumber(nWidthPix) && AscFormat.isRealNumber(nHeightPix)
&& AscFormat.isRealNumber(fWidth) && AscFormat.isRealNumber(fHeight)
)
this.asc_checkImageUrlAndAction(sImgSrc, function(oImage)
{
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