Sort by title option

This commit is contained in:
Mo Bitar
2017-08-22 16:06:47 -05:00
parent f85741e411
commit e1f6316e01
2 changed files with 13 additions and 1 deletions

View File

@@ -34,6 +34,7 @@ angular.module('app.frontend')
.controller('NotesCtrl', function (authManager, $timeout, $rootScope, modelManager) {
this.sortBy = localStorage.getItem("sortBy") || "created_at";
this.sortDescending = this.sortBy != "title";
$rootScope.$on("editorFocused", function(){
this.showMenu = false;
@@ -120,10 +121,17 @@ angular.module('app.frontend')
this.selectedSortByCreated = function() {
this.setSortBy("created_at");
this.sortDescending = true;
}
this.selectedSortByUpdated = function() {
this.setSortBy("updated_at");
this.sortDescending = true;
}
this.selectedSortByTitle = function() {
this.setSortBy("title");
this.sortDescending = false;
}
this.setSortBy = function(type) {