diff --git a/app/assets/javascripts/discourse/app/widgets/post-cooked.js b/app/assets/javascripts/discourse/app/widgets/post-cooked.js index 5de05a49967..de61a66b9e7 100644 --- a/app/assets/javascripts/discourse/app/widgets/post-cooked.js +++ b/app/assets/javascripts/discourse/app/widgets/post-cooked.js @@ -252,13 +252,16 @@ export default class PostCooked { let icon = iconHTML("arrow-up"); navLink = `${icon}`; + )}' title='${quoteTitle}' class='btn-flat back'>${icon}`; } // Only add the expand/contract control if it's not a full post let expandContract = ""; + const isExpanded = $aside.data("expanded") === true; if (!$aside.data("full")) { - expandContract = iconHTML(desc, { title: "post.expand_collapse" }); + let icon = iconHTML(desc, { title: "post.expand_collapse" }); + const quoteId = $aside.find("blockquote").attr("id"); + expandContract = ``; $(".title", $aside).css("cursor", "pointer"); } if (this.ignoredUsers && this.ignoredUsers.length > 0) { @@ -277,9 +280,14 @@ export default class PostCooked { return; } - $quotes.each((i, e) => { + $quotes.each((index, e) => { const $aside = $(e); if ($aside.data("post")) { + const quoteId = `quote-id-${$aside.data("topic")}-${$aside.data( + "post" + )}-${index}`; + $aside.find("blockquote").attr("id", quoteId); + this._updateQuoteElements($aside, "chevron-down"); const $title = $(".title", $aside); diff --git a/app/assets/stylesheets/common/base/topic-post.scss b/app/assets/stylesheets/common/base/topic-post.scss index 2ca3d905fdd..81d21b78a03 100644 --- a/app/assets/stylesheets/common/base/topic-post.scss +++ b/app/assets/stylesheets/common/base/topic-post.scss @@ -247,6 +247,12 @@ blockquote { color: var(--primary-low-mid-or-secondary-high); } +.quote-controls { + .quote-toggle { + padding: 0; + } +} + .cooked .highlight { background-color: var(--tertiary-low); padding: 2px;