Reselect first item on sort change
This commit is contained in:
@@ -254,8 +254,11 @@ angular.module('app')
|
||||
}
|
||||
}
|
||||
|
||||
this.selectedMenuItem = function($event) {
|
||||
this.showMenu = false;
|
||||
this.selectedMenuItem = function($event, hide) {
|
||||
if(hide) {
|
||||
this.showMenu = false;
|
||||
}
|
||||
$event.stopPropagation();
|
||||
}
|
||||
|
||||
this.deleteNote = function() {
|
||||
|
||||
@@ -40,7 +40,13 @@ angular.module('app')
|
||||
});
|
||||
|
||||
this.loadPreferences = function() {
|
||||
let prevSortValue = this.sortBy;
|
||||
this.sortBy = authManager.getUserPrefValue("sortBy", "created_at");
|
||||
if(prevSortValue && prevSortValue != this.sortBy) {
|
||||
$timeout(() => {
|
||||
this.selectFirstNote();
|
||||
})
|
||||
}
|
||||
this.sortDescending = this.sortBy != "title";
|
||||
|
||||
this.showArchived = authManager.getUserPrefValue("showArchived", false);
|
||||
|
||||
Reference in New Issue
Block a user