we were forced to bind here
This commit is contained in:
parent
dd9c23eb5e
commit
ab25ddcc3b
|
@ -41,6 +41,22 @@ export default Ember.Component.extend({
|
|||
return result;
|
||||
}.property('category'),
|
||||
|
||||
categoryColor: function() {
|
||||
var category = this.get('category');
|
||||
|
||||
if (category) {
|
||||
var color = get(category, 'color');
|
||||
|
||||
if (color) {
|
||||
var style = "";
|
||||
if (color) { style += "background-color: #" + color + ";" }
|
||||
return style;
|
||||
}
|
||||
}
|
||||
|
||||
return "background-color: #eee;";
|
||||
}.property('category'),
|
||||
|
||||
badgeStyle: function() {
|
||||
var category = this.get('category');
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{{#if category}}
|
||||
<a href {{action "expand"}} class="badge-category" {{bind-attr style="badgeStyle"}}>
|
||||
<span class="badge-category-bg" style="background-color: #{{unbound category.color}};"></span>
|
||||
<span class="badge-category-bg" {{bind-attr style="categoryColor"}}></span>
|
||||
{{#if category.read_restricted}}
|
||||
{{fa-icon "lock"}}
|
||||
{{/if}}
|
||||
|
|
Loading…
Reference in New Issue