Ability to display an error in the toolbar state
parent
8de9a596f1
commit
cf3024ef5b
|
@ -44,6 +44,7 @@ define(function () {
|
|||
out.typing = "Édition";
|
||||
out.initializing = "Initialisation...";
|
||||
out.forgotten = 'Déplacé vers la corbeille';
|
||||
out.errorState = 'Erreur critique : {0}';
|
||||
out.lag = 'Latence';
|
||||
out.readonly = 'Lecture seule';
|
||||
out.anonymous = "Anonyme";
|
||||
|
|
|
@ -43,9 +43,10 @@ define(function () {
|
|||
out.disconnected = 'Disconnected';
|
||||
out.synchronizing = 'Synchronizing';
|
||||
out.reconnecting = 'Reconnecting...';
|
||||
out.typing = "Typing";
|
||||
out.typing = "Editing";
|
||||
out.initializing = "Initializing...";
|
||||
out.forgotten = 'Moved to the trash';
|
||||
out.errorState = 'Critical error: {0}';
|
||||
out.lag = 'Lag';
|
||||
out.readonly = 'Read only';
|
||||
out.anonymous = "Anonymous";
|
||||
|
|
|
@ -691,6 +691,7 @@ define([
|
|||
var typing = -1;
|
||||
var kickSpinner = function (toolbar, config/*, local*/) {
|
||||
if (!toolbar.spinner) { return; }
|
||||
if (toolbar.isErrorState) { return; }
|
||||
var $spin = toolbar.spinner;
|
||||
|
||||
if (typing === -1) {
|
||||
|
@ -1050,6 +1051,17 @@ define([
|
|||
}
|
||||
};
|
||||
|
||||
toolbar.errorState = function (state, error) {
|
||||
toolbar.isErrorState = state;
|
||||
if (toolbar.spinner) {
|
||||
if (!state) {
|
||||
return void kickSpinner(toolbar, config);
|
||||
}
|
||||
var txt = Messages._getKey('errorState', [error]);
|
||||
toolbar.spinner.text(txt);
|
||||
}
|
||||
};
|
||||
|
||||
// When the pad is moved to the trash (forget button)
|
||||
toolbar.forgotten = function (/*userId*/) {
|
||||
toolbar.connected = false;
|
||||
|
|
Loading…
Reference in New Issue