Ability to display an error in the toolbar state
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user