From 36d46df8dca284bf2917e267ec6a45dde1faeda7 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Mon, 27 Nov 2017 13:21:34 -0500 Subject: [PATCH] New setting to show the reply title on the post menu on mobile --- .../javascripts/discourse/widgets/post-menu.js.es6 | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/assets/javascripts/discourse/widgets/post-menu.js.es6 b/app/assets/javascripts/discourse/widgets/post-menu.js.es6 index af926dc30e9..7b4483c28af 100644 --- a/app/assets/javascripts/discourse/widgets/post-menu.js.es6 +++ b/app/assets/javascripts/discourse/widgets/post-menu.js.es6 @@ -30,10 +30,10 @@ function registerButton(name, builder) { } export function buildButton(name, widget) { - let { attrs, state, siteSettings } = widget; + let { attrs, state, siteSettings, settings } = widget; let builder = _builders[name]; if (builder) { - let button = builder(attrs, state, siteSettings); + let button = builder(attrs, state, siteSettings, settings); if (button && !button.id) { button.id = name; } @@ -166,7 +166,7 @@ registerButton('share', attrs => { }; }); -registerButton('reply', attrs => { +registerButton('reply', (attrs, state, siteSettings, postMenuSettings) => { const args = { action: 'replyToPost', title: 'post.controls.reply', @@ -176,7 +176,7 @@ registerButton('reply', attrs => { if (!attrs.canCreatePost) { return; } - if (!attrs.mobileView) { + if (postMenuSettings.showReplyTitleOnMobile || !attrs.mobileView) { args.label = 'topic.reply.title'; } @@ -233,7 +233,8 @@ export default createWidget('post-menu', { settings: { collapseButtons: true, - buttonType: 'flat-button' + buttonType: 'flat-button', + showReplyTitleOnMobile: false }, defaultState() {