mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 12:42:57 +08:00
FIX: User card spacing was off
This commit is contained in:
parent
13c344245d
commit
2164d7d21c
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user