mirror of
https://github.com/flarum/core.git
synced 2025-10-12 23:44:27 +02:00
Add label to back button, change behaviour
The back button longer shows if the user hasn't actually navigated anywhere. e.g. if they come in directly to a discussion, it will be hidden.
This commit is contained in:
@@ -159,6 +159,7 @@ export default class DiscussionPage extends Page {
|
||||
show(discussion) {
|
||||
this.discussion = discussion;
|
||||
|
||||
app.history.push('discussion', discussion.title());
|
||||
app.setTitle(discussion.title());
|
||||
app.setTitleCount(0);
|
||||
|
||||
@@ -273,7 +274,7 @@ export default class DiscussionPage extends Page {
|
||||
m.route(url, true);
|
||||
window.history.replaceState(null, document.title, url);
|
||||
|
||||
app.history.push('discussion');
|
||||
app.history.push('discussion', discussion.title());
|
||||
|
||||
// If the user hasn't read past here before, then we'll update their read
|
||||
// state and redraw.
|
||||
|
@@ -54,7 +54,7 @@ export default class IndexPage extends Page {
|
||||
app.cache.discussionList = new DiscussionList({params});
|
||||
}
|
||||
|
||||
app.history.push('index');
|
||||
app.history.push('index', app.translator.trans('core.forum.header.discussions_button'));
|
||||
|
||||
this.bodyClass = 'App--index';
|
||||
}
|
||||
|
@@ -74,6 +74,7 @@ export default class UserPage extends Page {
|
||||
show(user) {
|
||||
this.user = user;
|
||||
|
||||
app.history.push('user', user.username());
|
||||
app.setTitle(user.username());
|
||||
|
||||
m.redraw();
|
||||
|
Reference in New Issue
Block a user