Added onWarning event to api.

This commit is contained in:
Julia Radzhabova 2018-01-09 15:10:48 +03:00
parent d184c3f647
commit 697785ff23
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

@ -398,6 +398,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

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

View file

@ -866,6 +866,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

@ -497,6 +497,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

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

View file

@ -821,6 +821,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

@ -405,6 +405,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

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

View file

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