Note panel options menu with archived

This commit is contained in:
Mo Bitar
2017-10-15 17:39:51 -05:00
parent 650464d474
commit 0838f927ab
6 changed files with 79 additions and 30 deletions

View File

@@ -53,15 +53,25 @@ angular.module('app.frontend')
this.notesToDisplay += 20
}
this.sortByTitle = function() {
var base = "Sort |";
this.optionsSubtitle = function() {
var base = "Sorting by";
if(this.sortBy == "created_at") {
return base + " Date added";
base += " date added";
} else if(this.sortBy == "updated_at") {
return base + " Date modifed";
base += " date modifed";
} else if(this.sortBy == "title") {
return base + " Title";
base += " title";
}
if(this.showArchived && !this.tag.archiveTag) {
base += " | Including archived"
}
return base;
}
this.toggleShowArchived = function() {
this.showArchived = !this.showArchived;
}
this.tagDidChange = function(tag, oldTag) {
@@ -114,11 +124,13 @@ angular.module('app.frontend')
this.filterNotes = function(note) {
if(this.tag.archiveTag) {
return note.archived;
note.visible = note.archived;
return note.visible;
}
if(note.archived) {
return false;
if(note.archived && !this.showArchived) {
note.visible = false;
return note.visible;
}
var filterText = this.noteFilter.text.toLowerCase();

View File

@@ -35,6 +35,7 @@ angular.module('app.frontend')
}
items = items || [];
console.log("Sorting", items.length, "items");
return items.sort(function(a, b){
return sortValueFn(a, b);
})