This commit is contained in:
Mo Bitar
2016-12-26 01:11:40 -06:00
parent 3c2e6b37c3
commit e3ea390abd
15 changed files with 82 additions and 74 deletions

View File

@@ -8,14 +8,6 @@ class BaseCtrl {
// $auth.updatePassword(data);
// apiController.setMk(new_keys.mk);
// }
// var note = new Note();
// note.content = {title: "hello", text: "world"};
// console.log("note content", note.content);
// console.log("note title", note.title);
// console.log("note json", JSON.stringify(note));
//
// console.log("Copy", _.cloneDeep(note));
}
}

View File

@@ -67,7 +67,7 @@ angular.module('app.frontend')
this.setNote = function(note, oldNote) {
this.editorMode = 'edit';
if(note.content.text.length == 0) {
if(note.content.text.length == 0 && note.dummy) {
this.focusTitle(100);
}
@@ -133,7 +133,10 @@ angular.module('app.frontend')
this.changesMade = function() {
this.note.hasChanges = true;
this.note.dummy = false;
apiController.saveDraftToDisk(this.note);
if(this.user.uuid) {
// signed out users have local autosave, dont need draft saving
apiController.saveDraftToDisk(this.note);
}
if(saveTimeout) $timeout.cancel(saveTimeout);
if(statusTimeout) $timeout.cancel(statusTimeout);

View File

@@ -74,6 +74,7 @@ angular.module('app.frontend')
$timeout(function(){
apiController.login(this.loginData.email, this.loginData.user_password, function(response){
if(response.errors) {
console.log("login error", response.errors);
this.loginData.status = response.errors[0];
} else {
this.onAuthSuccess(response.user);

View File

@@ -122,7 +122,7 @@ angular.module('app.frontend')
if(this.noteFilter.text.length == 0) {
note.visible = true;
} else {
note.visible = note.title.toLowerCase().includes(this.noteFilter.text) || note.text.toLowerCase().includes(this.noteFilter.text);
note.visible = note.content.title.toLowerCase().includes(this.noteFilter.text) || note.content.text.toLowerCase().includes(this.noteFilter.text);
}
return note.visible;
}.bind(this)