UX: Scroll to top of assigned list when switching users

This commit is contained in:
Ahmed Gagan 2020-08-04 20:56:10 +05:30 committed by GitHub
parent 8a77c932a7
commit 96c3d9d12e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 0 deletions

View File

@ -6,6 +6,15 @@ export default DiscourseRoute.extend({
ascending: { refreshModel: true }
},
beforeModel(transition) {
if (!(transition.hasOwnProperty("from") && transition.from)) {
return;
}
if (transition.from.localName === "show") {
this.session.set("topicListScrollPosition", 1);
}
},
model(params) {
let filter = null;
if (params.filter !== "everyone") {