mirror of
https://github.com/flarum/framework.git
synced 2025-02-21 07:50:24 +08:00
Simplify global back button
The behaviour is not overly intuitive, and the icon wasn't helping (hamburger icon usually means "menu"). Now the back button always goes back to the index, no matter where you are, and there's a tooltip that says "Back to discussion list".
This commit is contained in:
parent
c1c7d4c73a
commit
e3e4786391
@ -55,7 +55,7 @@ export default class IndexPage extends Page {
|
||||
app.cache.discussionList = new DiscussionList({params});
|
||||
}
|
||||
|
||||
app.history.push('index', icon('bars'));
|
||||
app.history.push('index', app.translator.trans('core.forum.header.back_to_index_tooltip'));
|
||||
|
||||
this.bodyClass = 'App--index';
|
||||
}
|
||||
|
@ -26,8 +26,6 @@ export default class UserPage extends Page {
|
||||
*/
|
||||
this.user = null;
|
||||
|
||||
app.history.push('user');
|
||||
|
||||
this.bodyClass = 'App--user';
|
||||
}
|
||||
|
||||
@ -74,7 +72,6 @@ export default class UserPage extends Page {
|
||||
show(user) {
|
||||
this.user = user;
|
||||
|
||||
app.history.push('user', user.username());
|
||||
app.setTitle(user.username());
|
||||
|
||||
m.redraw();
|
||||
|
@ -50,10 +50,10 @@ export default class Navigation extends Component {
|
||||
const previous = history.getPrevious() || {};
|
||||
|
||||
return LinkButton.component({
|
||||
className: 'Button Navigation-back ' + (previous.title ? '' : 'Button--icon'),
|
||||
className: 'Button Navigation-back Button--icon',
|
||||
href: history.backUrl(),
|
||||
icon: 'chevron-left',
|
||||
children: previous.title,
|
||||
title: previous.title,
|
||||
config: () => {},
|
||||
onclick: e => {
|
||||
if (e.shiftKey || e.ctrlKey || e.metaKey || e.which === 2) return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user