New setting to show the reply title on the post menu on mobile

This commit is contained in:
Robin Ward 2017-11-27 13:21:34 -05:00
parent 6aeeae287b
commit 36d46df8dc

View File

@ -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() {