define [
'issues/facets/base-facet'
+ 'templates/issues'
], (
BaseFacet
+ Templates
) ->
+ $ = jQuery
+
class extends BaseFacet
+ template: Templates['issues-component-facet']
+
+
+ onRender: ->
+ super
+ maxValueWidth = _.max @$('.facet-stat').map(-> $(@).outerWidth()).get()
+ @$('.facet-name').css 'padding-right', maxValueWidth
+
getValuesWithLabels: ->
values = @model.getValues()
--- /dev/null
+{{> '_issues-facet-header'}}
+
+<div class="issues-facet-list issues-facet-list-align-right">
+ {{#each values}}
+ <a class="facet issues-facet js-issues-facet" data-value="{{val}}" title="{{default label val}}">
+ <span class="facet-name">{{default label val}}</span>
+ <span class="facet-stat">{{count}}</span>
+ </a>
+ {{/each}}
+</div>
font-size: 0;
}
+.issues-facet-list-align-right {
+
+ .facet-name {
+ float: right;
+
+ &:before {
+ content: " ";
+ position: absolute;
+ top: 0; bottom: 0; left: 0;
+ width: 10px;
+ background-image: linear-gradient(to left, fade(@barBackgroundColor, 0%), @barBackgroundColor 75%);
+ }
+ }
+
+ .facet-stat:before {
+ display: none;
+ }
+
+ .facet.active .facet-name:before {
+ background-image: linear-gradient(to left, fade(@lightBlue, 0%), @lightBlue 75%);
+ }
+
+}
+
.issues-facet-container {
margin-top: 6px;
padding: 0 10px 16px;