Skip to content

Commit

Permalink
Merge pull request #4032 from AmericanRedCross/no-geocoder
Browse files Browse the repository at this point in the history
Omit global search UI when no geocoder service is available
  • Loading branch information
bhousel authored May 10, 2017
2 parents d1af98a + 41ee123 commit f5d1a63
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions modules/ui/feature_list.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,16 +186,18 @@ export function uiFeatureList(context) {
list.selectAll('.no-results-item .entity-name')
.text(noResultsWorldwide ? t('geocoder.no_results_worldwide') : t('geocoder.no_results_visible'));

list.selectAll('.geocode-item')
.data([0])
.enter().append('button')
.attr('class', 'geocode-item')
.on('click', geocoderSearch)
.append('div')
.attr('class', 'label')
.append('span')
.attr('class', 'entity-name')
.text(t('geocoder.search'));
if (services.geocoder) {
list.selectAll('.geocode-item')
.data([0])
.enter().append('button')
.attr('class', 'geocode-item')
.on('click', geocoderSearch)
.append('div')
.attr('class', 'label')
.append('span')
.attr('class', 'entity-name')
.text(t('geocoder.search'));
}

list.selectAll('.no-results-item')
.style('display', (value.length && !results.length) ? 'block' : 'none');
Expand Down

0 comments on commit f5d1a63

Please sign in to comment.