Scroll to selected entry on open

This commit is contained in:
Daniel Nyvik 2024-04-04 13:57:38 +02:00
parent 7fee323f68
commit 4a4551a199
2 changed files with 6 additions and 1 deletions

View File

@ -320,7 +320,11 @@ class AppModel {
this.activeEntryId = firstEntry ? firstEntry.id : null;
}
Events.emit('filter', { filter: this.filter, sort: this.sort, entries });
Events.emit('entry-selected', entries.get(this.activeEntryId));
const activeEntry = entries.get(this.activeEntryId);
Events.emit('entry-selected', activeEntry);
if (this.activeEntryId && activeEntry) {
Events.emit('select-list-item', activeEntry);
}
}
refresh() {

View File

@ -62,6 +62,7 @@ class ListView extends View {
this.listenTo(Events, 'filter', this.filterChanged);
this.listenTo(Events, 'entry-updated', this.entryUpdated);
this.listenTo(Events, 'set-locale', this.render);
this.listenTo(Events, 'select-list-item', this.selectItem);
this.listenTo(this.model.settings, 'change:tableView', this.setTableView);