1
0
mirror of https://github.com/flarum/core.git synced 2025-08-01 14:10:37 +02:00

Default force attr to true on LinkButton

This retains beta 13 behavior.
This commit is contained in:
Alexander Skvortsov
2020-10-15 18:18:51 -04:00
parent 9f5737eb93
commit e6f59b834f
2 changed files with 4 additions and 2 deletions

View File

@@ -12,12 +12,14 @@ import Link from './Link';
* active. * active.
* - `href` The URL to link to. If the current URL `m.route()` matches this, * - `href` The URL to link to. If the current URL `m.route()` matches this,
* the `active` prop will automatically be set to true. * the `active` prop will automatically be set to true.
* - `force` Whether the page should be fully rerendered. Defaults to `true`.
*/ */
export default class LinkButton extends Button { export default class LinkButton extends Button {
static initAttrs(attrs) { static initAttrs(attrs) {
super.initAttrs(attrs); super.initAttrs(attrs);
attrs.active = this.isActive(attrs); attrs.active = this.isActive(attrs);
if (attrs.force === undefined) attrs.force = true;
} }
view(vnode) { view(vnode) {

View File

@@ -135,7 +135,7 @@ export default class UserPage extends Page {
items.add( items.add(
'posts', 'posts',
<LinkButton href={app.route('user.posts', { username: user.username() })} force icon="far fa-comment"> <LinkButton href={app.route('user.posts', { username: user.username() })} icon="far fa-comment">
{app.translator.trans('core.forum.user.posts_link')} <span className="Button-badge">{user.commentCount()}</span> {app.translator.trans('core.forum.user.posts_link')} <span className="Button-badge">{user.commentCount()}</span>
</LinkButton>, </LinkButton>,
100 100
@@ -143,7 +143,7 @@ export default class UserPage extends Page {
items.add( items.add(
'discussions', 'discussions',
<LinkButton href={app.route('user.discussions', { username: user.username() })} force icon="fas fa-bars"> <LinkButton href={app.route('user.discussions', { username: user.username() })} icon="fas fa-bars">
{app.translator.trans('core.forum.user.discussions_link')} <span className="Button-badge">{user.discussionCount()}</span> {app.translator.trans('core.forum.user.discussions_link')} <span className="Button-badge">{user.discussionCount()}</span>
</LinkButton>, </LinkButton>,
90 90