Commit 5b4e4f0f authored by Alexander.Trofimov's avatar Alexander.Trofimov Committed by Alexander.Trofimov

Добавил в LoadDocumentImages callbackEnd (об окончании загрузки картинок в документе)

Переделал на новый callback загрузку картинок при открытии и при вставке.
Иначе могли быть проблемы с загрузкой картинок (при переключении листов): стали загружать, не дождались окончания, переключили лист

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@53357 954022d7-b5bf-4e40-9824-e11837661b57
parent 6f426561
...@@ -3060,7 +3060,7 @@ function DrawingObjects() { ...@@ -3060,7 +3060,7 @@ function DrawingObjects() {
} }
} }
api.ImageLoader.LoadDocumentImages(aImagesSync); api.ImageLoader.LoadDocumentImages(aImagesSync, null, _this.asyncImagesDocumentEndLoaded);
// Upload event // Upload event
if (window.addEventListener) { if (window.addEventListener) {
......
...@@ -2582,11 +2582,6 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS"; ...@@ -2582,11 +2582,6 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
}, },
asyncImagesDocumentEndLoaded: function() { asyncImagesDocumentEndLoaded: function() {
if ( this.wb ) {
var ws = this.wb.getWorksheet();
if ( ws.objectRender.asyncImagesDocumentEndLoaded )
ws.objectRender.asyncImagesDocumentEndLoaded();
}
}, },
asyncImageEndLoadedBackground: function() { asyncImageEndLoadedBackground: function() {
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
}*/ }*/
} }
this.LoadDocumentImages = function(_images, isUrl) { this.LoadDocumentImages = function(_images, isUrl, callbackEnd) {
// сначала заполним массив // сначала заполним массив
if (this.ThemeLoader == null) if (this.ThemeLoader == null)
this.Api.asyncImagesDocumentStartLoaded(); this.Api.asyncImagesDocumentStartLoaded();
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
if (!this.bIsAsyncLoadDocumentImages) if (!this.bIsAsyncLoadDocumentImages)
{ {
this._LoadImages(); this._LoadImages(callbackEnd);
} }
else else
{ {
...@@ -72,21 +72,29 @@ ...@@ -72,21 +72,29 @@
this.images_loading.splice(0, _len); this.images_loading.splice(0, _len);
if (null != callbackEnd)
callbackEnd();
else {
if (this.ThemeLoader == null) if (this.ThemeLoader == null)
this.Api.asyncImagesDocumentEndLoaded(); this.Api.asyncImagesDocumentEndLoaded();
else else
this.ThemeLoader.asyncImagesEndLoaded(); this.ThemeLoader.asyncImagesEndLoaded();
} }
} }
}
var oThis = this; var oThis = this;
this._LoadImages = function() { this._LoadImages = function(callbackEnd) {
if (0 == this.images_loading.length) if (0 == this.images_loading.length)
{ {
if (null != callbackEnd)
callbackEnd();
else {
if (this.ThemeLoader == null) if (this.ThemeLoader == null)
this.Api.asyncImagesDocumentEndLoaded(); this.Api.asyncImagesDocumentEndLoaded();
else else
this.ThemeLoader.asyncImagesEndLoaded(); this.ThemeLoader.asyncImagesEndLoaded();
}
return; return;
} }
...@@ -106,7 +114,7 @@ ...@@ -106,7 +114,7 @@
} }
oThis.images_loading.shift(); oThis.images_loading.shift();
oThis._LoadImages(); oThis._LoadImages(callbackEnd);
} }
oImage.Image.onerror = function(){ oImage.Image.onerror = function(){
oImage.Status = ImageLoadStatus.Complete; oImage.Status = ImageLoadStatus.Complete;
...@@ -119,7 +127,7 @@ ...@@ -119,7 +127,7 @@
} }
oThis.images_loading.shift(); oThis.images_loading.shift();
oThis._LoadImages(); oThis._LoadImages(callbackEnd);
} }
//oImage.Image.crossOrigin = 'anonymous'; //oImage.Image.crossOrigin = 'anonymous';
oImage.Image.src = oImage.src; oImage.Image.src = oImage.src;
......
...@@ -7607,7 +7607,7 @@ ...@@ -7607,7 +7607,7 @@
t.objectRender.objectLocker.checkObjects(callbackUngroupedObjects); t.objectRender.objectLocker.checkObjects(callbackUngroupedObjects);
}; };
api.ImageLoader.LoadDocumentImages(aImagesSync); api.ImageLoader.LoadDocumentImages(aImagesSync, null, t.objectRender.asyncImagesDocumentEndLoaded);
} }
}); });
}; };
......
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