FIX: Only add home class when there is no badge

This commit is contained in:
Robin Ward 2014-03-10 13:30:53 -04:00
parent 455ff61626
commit c430c6dd30
2 changed files with 9 additions and 1 deletions

View File

@ -34,6 +34,14 @@ Discourse.CategoryDropComponent = Ember.Component.extend({
return I18n.t('categories.all');
}.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() {
var category = this.get('category');
if (category) {

View File

@ -14,7 +14,7 @@
{{/if}}
{{#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'>
<div class='cat'><a {{bind-attr href=allCategoriesUrl}} data-drop-close="true" class='badge-category home'>{{allCategoriesLabel}}</a></div>
{{#if subCategory}}