Added onWarning event to api.

This commit is contained in:
Julia Radzhabova 2017-10-07 12:20:39 +03:00
parent 58d129ac79
commit 22580a02cb
11 changed files with 30 additions and 1 deletions

View file

@ -170,7 +170,8 @@
'onAppReady': <application ready callback>,
'onBack': <back to folder callback>,
'onError': <error callback>,
'onDocumentReady': <document ready callback>
'onDocumentReady': <document ready callback>,
'onWarning': <warning callback>
}
}
*/

View file

@ -189,6 +189,16 @@ if (Common === undefined) {
});
},
reportWarning: function(code, description) {
_postMessage({
event: 'onWarning',
data: {
warningCode: code,
warningDescription: description
}
});
},
sendInfo: function(info) {
_postMessage({
event: 'onInfo',

View file

@ -391,6 +391,8 @@ var ApplicationController = new(function(){
});
}
else {
Common.Gateway.reportWarning(id, message);
$('#id-critical-error-title').text(me.notcriticalErrorTitle);
$('#id-critical-error-message').text(message);
$('#id-critical-error-close').off();

View file

@ -1331,6 +1331,8 @@ define([
}
}
else {
Common.Gateway.reportWarning(id, config.msg);
config.title = this.notcriticalErrorTitle;
config.iconCls = 'warn';
config.buttons = ['ok'];

View file

@ -842,6 +842,8 @@ define([
}
}
else {
Common.Gateway.reportWarning(id, config.msg);
config.title = this.notcriticalErrorTitle;
config.callback = _.bind(function(btn){
if (id == Asc.c_oAscError.ID.Warning && btn == 'ok' && (this.appOptions.canDownload || this.appOptions.canDownloadOrigin)) {

View file

@ -495,6 +495,8 @@ var ApplicationController = new(function(){
});
}
else {
Common.Gateway.reportWarning(id, message);
$('#id-critical-error-title').text(me.notcriticalErrorTitle);
$('#id-critical-error-message').text(message);
$('#id-critical-error-close').off();

View file

@ -1085,6 +1085,8 @@ define([
}
}
else {
Common.Gateway.reportWarning(id, config.msg);
config.title = this.notcriticalErrorTitle;
config.iconCls = 'warn';
config.buttons = ['ok'];

View file

@ -802,6 +802,8 @@ define([
}
}
} else {
Common.Gateway.reportWarning(id, config.msg);
config.title = this.notcriticalErrorTitle;
config.callback = _.bind(function(btn){
if (id == Asc.c_oAscError.ID.Warning && btn == 'ok' && (this.appOptions.canDownload || this.appOptions.canDownloadOrigin)) {

View file

@ -403,6 +403,8 @@ var ApplicationController = new(function(){
});
}
else {
Common.Gateway.reportWarning(id, message);
$('#id-critical-error-title').text(me.notcriticalErrorTitle);
$('#id-critical-error-message').text(message);
$('#id-critical-error-close').off();

View file

@ -1242,6 +1242,8 @@ define([
}
}
} else {
Common.Gateway.reportWarning(id, config.msg);
config.title = this.notcriticalErrorTitle;
config.iconCls = 'warn';
config.buttons = ['ok'];

View file

@ -941,6 +941,8 @@ define([
}
}
else {
Common.Gateway.reportWarning(id, config.msg);
config.title = this.notcriticalErrorTitle;
// config.iconCls = 'warn';
// config.buttons = ['ok'];