0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-20 22:42:53 -05:00

Fixed clearing posts selection when navigating

fixes https://github.com/TryGhost/Team/issues/2983

When navigating, the posts selection will get cleared. This also fixes a bug with CMD+a that had an old event listener that was not cleared correctly, breakign CMD+A after navigation.
This commit is contained in:
Simon Backx 2023-04-11 15:53:01 +02:00
parent 114a6eb953
commit e938c2d5cc
2 changed files with 7 additions and 2 deletions

View file

@ -24,7 +24,7 @@ export default class ListComponent extends Component {
willDestroy() {
super.willDestroy(...arguments);
window.removeEventListener('keydown', this.onKeyDow, {passive: true});
window.removeEventListener('keydown', this.onKeyDown, {passive: true});
window.removeEventListener('keyup', this.onKeyUp, {passive: true});
window.removeEventListener('click', this.onWindowClicked, {passive: true});
window.removeEventListener('blur', this.onWindowBlur, {passive: true});

View file

@ -79,7 +79,7 @@ export default class PostsRoute extends AuthenticatedRoute {
}
// trigger a background load of all tags and authors for use in filter dropdowns
setupController(controller) {
setupController(controller, model) {
super.setupController(...arguments);
if (!controller._hasLoadedTags) {
@ -93,6 +93,11 @@ export default class PostsRoute extends AuthenticatedRoute {
controller._hasLoadedAuthors = true;
});
}
if (controller.selectionList) {
controller.selectionList.infinityModel = model;
controller.selectionList.clearSelection();
}
}
@action