Commit 803d5dd5 authored by Sergey.Konovalov's avatar Sergey.Konovalov Committed by Alexander.Trofimov

проблемы с upload картинок в ie

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@49436 954022d7-b5bf-4e40-9824-e11837661b57
parent c67ca7e7
......@@ -4593,18 +4593,21 @@ function DrawingObjects() {
var fileSubmit = frameWindow.document.getElementById("apiiuSubmit");
fileName.onchange = function(e) {
var bNeedSubmit = true;
if(e && e.target && e.target.files)
{
var files = e.target.files;
var nError = ValidateUploadImage(files);
if(c_oAscServerError.NoError == nError)
var nError = ValidateUploadImage(e.target.files);
if(c_oAscServerError.NoError != nError)
{
bNeedSubmit = false;
worksheet.model.workbook.handlers.trigger("asc_onError", api.asc_mapAscServerErrorToAscError(nError), c_oAscError.Level.NoCritical);
}
}
if(bNeedSubmit)
{
worksheet.model.workbook.handlers.trigger("asc_onStartAction", c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.LoadImage);
fileSubmit.click();
}
else
worksheet.model.workbook.handlers.trigger("asc_onError", api.asc_mapAscServerErrorToAscError(nError), c_oAscError.Level.NoCritical);
}
}
if (window.opera != undefined)
......
......@@ -2556,22 +2556,22 @@ asc_docs_api.prototype.AddImage = function(){
var oThis = this;
fileName.onchange = function(e)
{
var bNeedSubmit = true;
if(e && e.target && e.target.files)
{
var files = e.target.files;
if(files.length > 0)
{
var file = files[0];
var nError = ValidateUploadImage(files);
if(c_oAscServerError.NoError == nError)
var nError = ValidateUploadImage(e.target.files);
if(c_oAscServerError.NoError != nError)
{
oThis.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.UploadImage);
fileSubmit.click();
}
else
bNeedSubmit = false;
oThis.asc_fireCallback("asc_onError",_mapAscServerErrorToAscError(nError),c_oAscError.Level.NoCritical);
}
}
if(bNeedSubmit)
{
oThis.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.UploadImage);
fileSubmit.click();
}
};
//todo пересмотреть opera
if (window.opera != undefined)
......
......@@ -4661,18 +4661,21 @@ asc_docs_api.prototype.AddImage = function(){
var oThis = this;
fileName.onchange = function(e)
{
var bNeedSubmit = true;
if(e && e.target && e.target.files)
{
var files = e.target.files;
var nError = ValidateUploadImage(files);
if(c_oAscServerError.NoError == nError)
var nError = ValidateUploadImage(e.target.files);
if(c_oAscServerError.NoError != nError)
{
bNeedSubmit = false;
oThis.asc_fireCallback("asc_onError",_mapAscServerErrorToAscError(nError),c_oAscError.Level.NoCritical);
}
}
if(bNeedSubmit)
{
oThis.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.UploadImage);
fileSubmit.click();
}
else
oThis.asc_fireCallback("asc_onError",_mapAscServerErrorToAscError(nError),c_oAscError.Level.NoCritical);
}
};
//todo пересмотреть opera
if (window.opera != undefined)
......
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