diff options
Diffstat (limited to 'app/assets/javascripts/filtered_search/dropdown_ajax_filter.js')
-rw-r--r-- | app/assets/javascripts/filtered_search/dropdown_ajax_filter.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/app/assets/javascripts/filtered_search/dropdown_ajax_filter.js b/app/assets/javascripts/filtered_search/dropdown_ajax_filter.js index 4652dfe71c3..30f412e590f 100644 --- a/app/assets/javascripts/filtered_search/dropdown_ajax_filter.js +++ b/app/assets/javascripts/filtered_search/dropdown_ajax_filter.js @@ -22,7 +22,7 @@ export default class DropdownAjaxFilter extends FilteredSearchDropdown { ajaxFilterConfig() { return { - endpoint: `${gon.relative_url_root || ''}${this.endpoint}`, + endpoint: this.endpoint, searchKey: 'search', searchValueFunction: this.getSearchInput.bind(this), loadingTemplate: this.loadingTemplate, @@ -33,9 +33,11 @@ export default class DropdownAjaxFilter extends FilteredSearchDropdown { } itemClicked(e) { - super.itemClicked(e, selected => - selected.querySelector('.dropdown-light-content').innerText.trim(), - ); + super.itemClicked(e, selected => { + const title = selected.querySelector('.dropdown-light-content').innerText.trim(); + + return DropdownUtils.getEscapedText(title); + }); } renderContent(forceShowList = false) { |