From 2164d7d21c34ef76ce10a948c1c194eb638735c5 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Wed, 14 Dec 2016 10:45:51 -0500 Subject: [PATCH] FIX: User card spacing was off --- .../discourse/components/user-card-contents.js.es6 | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/app/assets/javascripts/discourse/components/user-card-contents.js.es6 b/app/assets/javascripts/discourse/components/user-card-contents.js.es6 index ccac108e9f0..81d7e5c93e8 100644 --- a/app/assets/javascripts/discourse/components/user-card-contents.js.es6 +++ b/app/assets/javascripts/discourse/components/user-card-contents.js.es6 @@ -12,7 +12,7 @@ const clickMention = "click.discourse-user-mention"; export default Ember.Component.extend(CleansUp, { elementId: 'user-card', - classNameBindings: ['visible:show', 'showBadges', 'hasCardBadgeImage'], + classNameBindings: ['visible:show', 'showBadges', 'hasCardBadgeImage', 'user.card_background::no-bg'], allowBackgrounds: setting('allow_profile_backgrounds'), postStream: Ember.computed.alias('topic.postStream'), @@ -71,18 +71,14 @@ export default Ember.Component.extend(CleansUp, { @observes('user.card_background') addBackground() { - const url = this.get('user.card_background'); - if (!this.get('allowBackgrounds')) { return; } const $this = this.$(); if (!$this) { return; } - if (Ember.isEmpty(url)) { - $this.css('background-image', '').addClass('no-bg'); - } else { - $this.css('background-image', `url(${Discourse.getURLWithCDN(url)})`).removeClass('no-bg'); - } + const url = this.get('user.card_background'); + const bg = Ember.isEmpty(url) ? '' : `url(${Discourse.getURLWithCDN(url)})`; + $this.css('background-image', bg); }, _show(username, $target) {