From 494ad1e9de6ffbfc9b273d493ed60c6dc613e77f Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Fri, 6 Oct 2017 15:27:02 -0400 Subject: [PATCH] Convert quote controls to use `d-icon` --- .../javascripts/discourse/widgets/post-cooked.js.es6 | 6 ++++-- app/assets/stylesheets/common/base/topic-post.scss | 7 ++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/app/assets/javascripts/discourse/widgets/post-cooked.js.es6 b/app/assets/javascripts/discourse/widgets/post-cooked.js.es6 index 447a0700c9b..b9ffee95856 100644 --- a/app/assets/javascripts/discourse/widgets/post-cooked.js.es6 +++ b/app/assets/javascripts/discourse/widgets/post-cooked.js.es6 @@ -163,7 +163,8 @@ export default class PostCooked { // If we have a post reference if (postNumber) { - navLink = ``; + let icon = iconHTML('arrow-up'); + navLink = `${icon}`; } // Only add the expand/contract control if it's not a full post @@ -188,7 +189,8 @@ export default class PostCooked { // Unless it's a full quote, allow click to expand if (!($aside.data('full') || $title.data('has-quote-controls'))) { $title.on('click', e2 => { - if ($(e2.target).is('a')) return true; + let $target = $(e2.target); + if ($target.closest('a').length) { return true; } this._toggleQuote($aside); }); $title.data('has-quote-controls', true); diff --git a/app/assets/stylesheets/common/base/topic-post.scss b/app/assets/stylesheets/common/base/topic-post.scss index 3e843ce3de4..58d20523f11 100644 --- a/app/assets/stylesheets/common/base/topic-post.scss +++ b/app/assets/stylesheets/common/base/topic-post.scss @@ -87,7 +87,7 @@ aside.quote { } } -.quote-controls { +.quote-controls, .quote-controls .d-icon { color: dark-light-choose(scale-color($primary, $lightness: 70%), scale-color($secondary, $lightness: 30%)); } @@ -114,8 +114,9 @@ aside.quote { .quote-controls { float: right; - a { - margin: 0; + display: flex; + .d-icon { + margin-left: 0.2em; } }