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,17 +4593,20 @@ function DrawingObjects() { ...@@ -4593,17 +4593,20 @@ function DrawingObjects() {
var fileSubmit = frameWindow.document.getElementById("apiiuSubmit"); var fileSubmit = frameWindow.document.getElementById("apiiuSubmit");
fileName.onchange = function(e) { fileName.onchange = function(e) {
var bNeedSubmit = true;
if(e && e.target && e.target.files) if(e && e.target && e.target.files)
{ {
var files = e.target.files; var nError = ValidateUploadImage(e.target.files);
var nError = ValidateUploadImage(files); if(c_oAscServerError.NoError != nError)
if(c_oAscServerError.NoError == nError)
{ {
worksheet.model.workbook.handlers.trigger("asc_onStartAction", c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.LoadImage); bNeedSubmit = false;
fileSubmit.click();
}
else
worksheet.model.workbook.handlers.trigger("asc_onError", api.asc_mapAscServerErrorToAscError(nError), c_oAscError.Level.NoCritical); 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();
} }
} }
......
...@@ -2556,22 +2556,22 @@ asc_docs_api.prototype.AddImage = function(){ ...@@ -2556,22 +2556,22 @@ asc_docs_api.prototype.AddImage = function(){
var oThis = this; var oThis = this;
fileName.onchange = function(e) fileName.onchange = function(e)
{ {
var bNeedSubmit = true;
if(e && e.target && e.target.files) if(e && e.target && e.target.files)
{ {
var files = e.target.files; var file = files[0];
if(files.length > 0) var nError = ValidateUploadImage(e.target.files);
{ if(c_oAscServerError.NoError != nError)
var file = files[0]; {
var nError = ValidateUploadImage(files); bNeedSubmit = false;
if(c_oAscServerError.NoError == nError) oThis.asc_fireCallback("asc_onError",_mapAscServerErrorToAscError(nError),c_oAscError.Level.NoCritical);
{ }
oThis.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.UploadImage);
fileSubmit.click();
}
else
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 //todo пересмотреть opera
if (window.opera != undefined) if (window.opera != undefined)
......
...@@ -4661,17 +4661,20 @@ asc_docs_api.prototype.AddImage = function(){ ...@@ -4661,17 +4661,20 @@ asc_docs_api.prototype.AddImage = function(){
var oThis = this; var oThis = this;
fileName.onchange = function(e) fileName.onchange = function(e)
{ {
var bNeedSubmit = true;
if(e && e.target && e.target.files) if(e && e.target && e.target.files)
{ {
var files = e.target.files; var nError = ValidateUploadImage(e.target.files);
var nError = ValidateUploadImage(files); if(c_oAscServerError.NoError != nError)
if(c_oAscServerError.NoError == nError)
{ {
oThis.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.UploadImage); bNeedSubmit = false;
fileSubmit.click();
}
else
oThis.asc_fireCallback("asc_onError",_mapAscServerErrorToAscError(nError),c_oAscError.Level.NoCritical); 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 //todo пересмотреть opera
......
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