Client updated at

This commit is contained in:
Mo Bitar
2018-06-01 11:03:57 -05:00
parent f17c5995c6
commit 53300ac1b6
5 changed files with 42 additions and 12 deletions

View File

@@ -326,19 +326,16 @@ angular.module('app')
this.togglePin = function() {
this.note.setAppDataItem("pinned", !this.note.pinned);
this.note.setDirty(true);
this.changesMade();
}
this.toggleLockNote = function() {
this.note.setAppDataItem("locked", !this.note.locked);
this.note.setDirty(true);
this.changesMade();
}
this.toggleArchiveNote = function() {
this.note.setAppDataItem("archived", !this.note.archived);
this.note.setDirty(true);
this.changesMade(true);
$rootScope.$broadcast("noteArchived");
}

View File

@@ -41,7 +41,14 @@ angular.module('app')
this.loadPreferences = function() {
let prevSortValue = this.sortBy;
this.sortBy = authManager.getUserPrefValue("sortBy", "created_at");
if(this.sortBy == "updated_at") {
// use client_updated_at instead
this.sortBy = "client_updated_at";
}
if(prevSortValue && prevSortValue != this.sortBy) {
$timeout(() => {
this.selectFirstNote();
@@ -120,7 +127,7 @@ angular.module('app')
var base = "";
if(this.sortBy == "created_at") {
base += " Date Added";
} else if(this.sortBy == "updated_at") {
} else if(this.sortBy == "client_updated_at") {
base += " Date Modifed";
} else if(this.sortBy == "title") {
base += " Title";
@@ -274,7 +281,7 @@ angular.module('app')
}
this.selectedSortByUpdated = function() {
this.setSortBy("updated_at");
this.setSortBy("client_updated_at");
this.sortDescending = true;
}