add translationPath option to dropdown-select-multiple filter
This commit is contained in:
@@ -8,6 +8,7 @@ export default Ember.Component.extend
|
||||
eager_filter: false # filter on single select
|
||||
has_active_filter_value: Ember.computed.bool 'selected.length'
|
||||
search_string: ''
|
||||
translationPath: '' # if set indicating a flat select requiring translated values
|
||||
search_placeholder: 'Search...' #.htmlSafe()
|
||||
filtered_options: Ember.computed 'options.length', 'search_string', ->
|
||||
return @get('options') unless @get('search_string.length') > 1
|
||||
@@ -31,6 +32,12 @@ export default Ember.Component.extend
|
||||
result_html += '<br><hr>' if result_html
|
||||
result_html += get(option, labelPath)
|
||||
result_html
|
||||
else if translationPath = @get('translationPath')
|
||||
result_html = ''
|
||||
@get('selected').forEach (value) ->
|
||||
result_html += '<br><hr>' if result_html
|
||||
result_html += t(value, scope: translationPath, default: value)
|
||||
result_html
|
||||
else
|
||||
@get('selected').join('<br><hr>')
|
||||
selected_display: Ember.computed 'selected.length', ->
|
||||
|
||||
Reference in New Issue
Block a user