From 1269103fbb087c43d845fd303bf538106550e39e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Fri, 27 Nov 2020 16:56:18 -0500 Subject: [PATCH] fix: #8984, post-queue ux --- public/language/en-GB/post-queue.json | 4 +++- public/src/client/post-queue.js | 19 +++++++++++++++++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/public/language/en-GB/post-queue.json b/public/language/en-GB/post-queue.json index b5f73c5613..24eae3ad7d 100644 --- a/public/language/en-GB/post-queue.json +++ b/public/language/en-GB/post-queue.json @@ -8,5 +8,7 @@ "content": "Content", "posted": "Posted", "reply-to": "Reply to \"%1\"", - "content-editable": "You can click on individual content to edit before posting." + "content-editable": "You can click on individual content to edit before posting.", + "category-editable": "Click to edit the category of this new topic", + "title-editable": "Click to edit the title of this new topic" } \ No newline at end of file diff --git a/public/src/client/post-queue.js b/public/src/client/post-queue.js index cc52615539..06d2e5b56a 100644 --- a/public/src/client/post-queue.js +++ b/public/src/client/post-queue.js @@ -58,7 +58,12 @@ define('forum/post-queue', [ category: category, }], }, function (html) { - $this.replaceWith(html.find('.topic-category')); + if ($this.find('.category-text').length) { + $this.find('.category-text').text(html.find('.topic-category .category-text').text()); + } else { + // for backwards compatibility, remove in 1.16.0 + $this.replaceWith(html.find('.topic-category')); + } }); }); }); @@ -92,7 +97,17 @@ define('forum/post-queue', [ if (err) { return app.alertError(err); } - preview.html(titleEdit ? data.postData.title : data.postData.content); + if (titleEdit) { + if (preview.find('.title-text').length) { + preview.find('.title-text').text(data.postData.title); + } else { + // for backwards compatibility, remove in 1.16.0 + preview.html(data.postData.title); + } + } else { + preview.html(data.postData.content); + } + textarea.parent().addClass('hidden'); preview.removeClass('hidden'); });