Ability to display an error in the toolbar state

This commit is contained in:
yflory
2017-11-03 14:26:38 +01:00
parent 8de9a596f1
commit cf3024ef5b
3 changed files with 15 additions and 1 deletions

View File

@@ -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;