This commit is contained in:
Mo Bitar
2017-01-31 00:54:22 -06:00
parent c93eba279d
commit fd44b694b0
4 changed files with 11 additions and 6 deletions

View File

@@ -1,5 +1,5 @@
angular.module('app.frontend')
.directive("editorSection", function($timeout){
.directive("editorSection", function($timeout, $sce){
return {
restrict: 'E',
scope: {
@@ -153,13 +153,13 @@ angular.module('app.frontend')
status += " (offline)";
}
this.saveError = false;
this.noteStatus = status;
this.noteStatus = $sce.trustAsHtml(status);
}.bind(this), 200)
} else {
if(statusTimeout) $timeout.cancel(statusTimeout);
statusTimeout = $timeout(function(){
this.saveError = true;
this.noteStatus = "Error saving"
this.noteStatus = $sce.trustAsHtml("Error syncing<br>(changed saved offline)")
}.bind(this), 200)
}
}.bind(this));
@@ -179,7 +179,7 @@ angular.module('app.frontend')
if(saveTimeout) $timeout.cancel(saveTimeout);
if(statusTimeout) $timeout.cancel(statusTimeout);
saveTimeout = $timeout(function(){
this.noteStatus = "Saving...";
this.noteStatus = $sce.trustAsHtml("Saving...");
this.saveNote();
}.bind(this), 275)
}

View File

@@ -107,7 +107,9 @@ angular.module('app.frontend')
$scope.didShowErrorAlert = true;
alert("There was an error saving your note. Please try again.");
}
callback(false);
if(callback) {
callback(false);
}
} else {
note.hasChanges = false;
if(callback) {