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);
|
||||
|
||||
@@ -13,7 +13,8 @@ class MenuRow {
|
||||
buttonClass: "=",
|
||||
buttonAction: "&",
|
||||
spinnerClass: "=",
|
||||
subRows: "="
|
||||
subRows: "=",
|
||||
faded: "="
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -316,7 +316,7 @@ angular.module('app')
|
||||
}
|
||||
|
||||
this.getUserPrefValue = function(key, defaultValue) {
|
||||
if(!this.userPreferences) { return; }
|
||||
if(!this.userPreferences) { return defaultValue; }
|
||||
var value = this.userPreferences.getAppDataItem(key);
|
||||
return (value !== undefined && value != null) ? value : defaultValue;
|
||||
}
|
||||
|
||||
@@ -109,8 +109,6 @@ class SingletonManager {
|
||||
this.modelManager.setItemToBeDeleted(d);
|
||||
}
|
||||
|
||||
console.log("Syncing from SM");
|
||||
|
||||
this.$rootScope.sync();
|
||||
|
||||
// Send remaining item to callback
|
||||
|
||||
@@ -191,8 +191,6 @@ class SyncManager {
|
||||
|
||||
sync(callback, options = {}) {
|
||||
|
||||
console.log("Sync");
|
||||
|
||||
var allDirtyItems = this.modelManager.getDirtyItems();
|
||||
|
||||
if(this.syncStatus.syncOpInProgress) {
|
||||
|
||||
Reference in New Issue
Block a user