FIX: Only add `home` class when there is no badge
This commit is contained in:
parent
455ff61626
commit
c430c6dd30
|
@ -34,6 +34,14 @@ Discourse.CategoryDropComponent = Ember.Component.extend({
|
||||||
return I18n.t('categories.all');
|
return I18n.t('categories.all');
|
||||||
}.property('category'),
|
}.property('category'),
|
||||||
|
|
||||||
|
dropdownButtonClass: function() {
|
||||||
|
var result = 'badge-category category-dropdown-button';
|
||||||
|
if (Em.isNone(this.get('category'))) {
|
||||||
|
result += ' home';
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}.property('category'),
|
||||||
|
|
||||||
badgeStyle: function() {
|
badgeStyle: function() {
|
||||||
var category = this.get('category');
|
var category = this.get('category');
|
||||||
if (category) {
|
if (category) {
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{#if categories}}
|
{{#if categories}}
|
||||||
<a href='#' {{action expand}} class='badge-category category-dropdown-button home' {{bind-attr style="badgeStyle"}}><i {{bind-attr class="iconClass"}}></i></a>
|
<a href='#' {{action expand}} {{bind-attr class="dropdownButtonClass" style="badgeStyle"}}><i {{bind-attr class="iconClass"}}></i></a>
|
||||||
<section {{bind-attr class="expanded::hidden :category-dropdown-menu"}} class='chooser'>
|
<section {{bind-attr class="expanded::hidden :category-dropdown-menu"}} class='chooser'>
|
||||||
<div class='cat'><a {{bind-attr href=allCategoriesUrl}} data-drop-close="true" class='badge-category home'>{{allCategoriesLabel}}</a></div>
|
<div class='cat'><a {{bind-attr href=allCategoriesUrl}} data-drop-close="true" class='badge-category home'>{{allCategoriesLabel}}</a></div>
|
||||||
{{#if subCategory}}
|
{{#if subCategory}}
|
||||||
|
|
Loading…
Reference in New Issue