mirror of
https://github.com/discourse/discourse.git
synced 2025-01-19 22:12:45 +08:00
New setting to show the reply title on the post menu on mobile
This commit is contained in:
parent
6aeeae287b
commit
36d46df8dc
|
@ -30,10 +30,10 @@ function registerButton(name, builder) {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function buildButton(name, widget) {
|
export function buildButton(name, widget) {
|
||||||
let { attrs, state, siteSettings } = widget;
|
let { attrs, state, siteSettings, settings } = widget;
|
||||||
let builder = _builders[name];
|
let builder = _builders[name];
|
||||||
if (builder) {
|
if (builder) {
|
||||||
let button = builder(attrs, state, siteSettings);
|
let button = builder(attrs, state, siteSettings, settings);
|
||||||
if (button && !button.id) {
|
if (button && !button.id) {
|
||||||
button.id = name;
|
button.id = name;
|
||||||
}
|
}
|
||||||
|
@ -166,7 +166,7 @@ registerButton('share', attrs => {
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
registerButton('reply', attrs => {
|
registerButton('reply', (attrs, state, siteSettings, postMenuSettings) => {
|
||||||
const args = {
|
const args = {
|
||||||
action: 'replyToPost',
|
action: 'replyToPost',
|
||||||
title: 'post.controls.reply',
|
title: 'post.controls.reply',
|
||||||
|
@ -176,7 +176,7 @@ registerButton('reply', attrs => {
|
||||||
|
|
||||||
if (!attrs.canCreatePost) { return; }
|
if (!attrs.canCreatePost) { return; }
|
||||||
|
|
||||||
if (!attrs.mobileView) {
|
if (postMenuSettings.showReplyTitleOnMobile || !attrs.mobileView) {
|
||||||
args.label = 'topic.reply.title';
|
args.label = 'topic.reply.title';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -233,7 +233,8 @@ export default createWidget('post-menu', {
|
||||||
|
|
||||||
settings: {
|
settings: {
|
||||||
collapseButtons: true,
|
collapseButtons: true,
|
||||||
buttonType: 'flat-button'
|
buttonType: 'flat-button',
|
||||||
|
showReplyTitleOnMobile: false
|
||||||
},
|
},
|
||||||
|
|
||||||
defaultState() {
|
defaultState() {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user