Update error text and style

This commit is contained in:
Mo Bitar
2018-05-31 10:36:33 -05:00
parent ef61c7bc6a
commit b90ea97fcb
4 changed files with 18 additions and 10 deletions

View File

@@ -229,15 +229,11 @@ angular.module('app')
if(success) {
if(statusTimeout) $timeout.cancel(statusTimeout);
statusTimeout = $timeout(function(){
this.saveError = false;
this.syncTakingTooLong = false;
this.showAllChangesSavedStatus();
}.bind(this), 200)
} else {
if(statusTimeout) $timeout.cancel(statusTimeout);
statusTimeout = $timeout(function(){
this.saveError = true;
this.syncTakingTooLong = false;
this.showErrorStatus();
}.bind(this), 200)
}
@@ -277,6 +273,9 @@ angular.module('app')
}
this.showAllChangesSavedStatus = function() {
this.saveError = false;
this.syncTakingTooLong = false;
var status = "All changes saved";
if(authManager.offline()) {
status += " (offline)";
@@ -285,7 +284,9 @@ angular.module('app')
}
this.showErrorStatus = function() {
this.noteStatus = $sce.trustAsHtml("Error syncing<br>(changes saved offline)")
this.saveError = true;
this.syncTakingTooLong = false;
this.noteStatus = $sce.trustAsHtml("<span class='error bold'>Sync Unreachable</span><br>All changes saved offline")
}
this.contentChanged = function() {