diff --git a/app/assets/javascripts/app/frontend/controllers/editor.js b/app/assets/javascripts/app/frontend/controllers/editor.js index c0c8e2909..f46add16d 100644 --- a/app/assets/javascripts/app/frontend/controllers/editor.js +++ b/app/assets/javascripts/app/frontend/controllers/editor.js @@ -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
(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) } diff --git a/app/assets/javascripts/app/frontend/controllers/home.js b/app/assets/javascripts/app/frontend/controllers/home.js index b8beb85ec..507f3c931 100644 --- a/app/assets/javascripts/app/frontend/controllers/home.js +++ b/app/assets/javascripts/app/frontend/controllers/home.js @@ -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) { diff --git a/app/assets/stylesheets/app/_editor.scss b/app/assets/stylesheets/app/_editor.scss index 20b7b4e44..6404713d5 100644 --- a/app/assets/stylesheets/app/_editor.scss +++ b/app/assets/stylesheets/app/_editor.scss @@ -68,6 +68,9 @@ .save-status { width: 20% !important; float: right; + position: absolute; + + right: 20px; font-size: 12px; text-transform: none; font-weight: normal; diff --git a/app/assets/templates/frontend/editor.html.haml b/app/assets/templates/frontend/editor.html.haml index 50461f012..af7635754 100644 --- a/app/assets/templates/frontend/editor.html.haml +++ b/app/assets/templates/frontend/editor.html.haml @@ -5,7 +5,7 @@ %input.input#note-title-editor{"ng-model" => "ctrl.note.title", "ng-keyup" => "$event.keyCode == 13 && ctrl.saveTitle($event)", "ng-change" => "ctrl.nameChanged()", "ng-focus" => "ctrl.onNameFocus()", "select-on-click" => "true"} - .save-status{"ng-class" => "{'red bold': ctrl.saveError}"} {{ctrl.noteStatus}} + .save-status{"ng-class" => "{'red bold': ctrl.saveError}", "ng-bind-html" => "ctrl.noteStatus"} .tags %input.tags-input{"type" => "text", "ng-keyup" => "$event.keyCode == 13 && ctrl.updateTagsFromTagsString($event, ctrl.tagsString)", "ng-model" => "ctrl.tagsString", "placeholder" => "#tags", "ng-blur" => "ctrl.updateTagsFromTagsString($event, ctrl.tagsString)"}