From 7b7aad625bf38bffe7be51815ecb6b06d9ccc1be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Wed, 19 Aug 2020 19:26:26 +0200 Subject: [PATCH] CategoryOverpassFilter: replace 'defaultQuery' by 'emptyQuery' --- doc/Filters.md | 2 +- src/CategoryOverpassFilter.js | 11 +---------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/doc/Filters.md b/doc/Filters.md index 4e857465..c424ee4f 100644 --- a/doc/Filters.md +++ b/doc/Filters.md @@ -37,7 +37,7 @@ Each filter can define the following values: * 'strsearch' query string parts (e.g. "kai keb" would match "Kaiser Kebap") and query character variants (e.g. "cafe" would match "café"). * show_default: if true, this filter will be shown by default, others need to be added via the select box. * placeholder: a text which is shown as placeholder (Twig enabled) -* defaultQuery: A filter query which is added when no value is selected. +* emptyQuery: A Overpass filter query which is added, when no value is selected. ### Values #### Array diff --git a/src/CategoryOverpassFilter.js b/src/CategoryOverpassFilter.js index 568f4c40..7e9914bc 100644 --- a/src/CategoryOverpassFilter.js +++ b/src/CategoryOverpassFilter.js @@ -169,7 +169,7 @@ class CategoryOverpassFilter { let d = this.data[k] if (values === null) { - return null + return d.emptyQuery } if (!Array.isArray(values)) { @@ -233,15 +233,6 @@ class CategoryOverpassFilter { } }).filter(f => f) // remove null values - const defaultQueries = Object.keys(this.data) - .map(k => { - if (!param[k]) { - return this.data[k].defaultQuery - } - }) - .filter(f => f) - this.additionalFilter = this.additionalFilter.concat(defaultQueries) - if (this.additionalFilter.length === 0) { this.additionalFilter = [] } else if (this.additionalFilter.length === 1) {