1
0
mirror of https://github.com/flarum/core.git synced 2025-08-08 09:26:34 +02:00

Move title setting for index page to its own method so it can be used in reloads caused by route changes

This commit is contained in:
Alexander Skvortsov
2020-08-13 11:01:39 -04:00
committed by Franz Liedke
parent 94d8f7e726
commit f1fc0fecb7

View File

@@ -53,9 +53,9 @@ export default class IndexPage extends Page {
app.discussions.refreshParams(app.search.params());
this.currentPath = curPath;
}
console.log('IndexPage#onbeforeupdate');
this.setTitle();
}
}
view() {
@@ -80,11 +80,15 @@ export default class IndexPage extends Page {
);
}
setTitle() {
app.setTitle(app.translator.trans('core.forum.index.meta_title_text'));
app.setTitleCount(0);
}
oncreate(vnode) {
super.oncreate(vnode);
app.setTitle(app.translator.trans('core.forum.index.meta_title_text'));
app.setTitleCount(0);
this.setTitle();
// Work out the difference between the height of this hero and that of the
// previous hero. Maintain the same scroll position relative to the bottom