|
|
@ -139,16 +139,22 @@ class CategoryOverpassFilter { |
|
|
|
|
|
|
|
this.formFilter = new form('filter-' + this.master.id, this.data, masterOptions) |
|
|
|
this.formFilter.show(this.domFilter) |
|
|
|
this.formFilter.onchange = function () { |
|
|
|
this.formFilter.onchange = () => { |
|
|
|
let param = JSON.parse(JSON.stringify(this.formFilter.get_data())) |
|
|
|
|
|
|
|
this.applyParam(param) |
|
|
|
|
|
|
|
state.update() |
|
|
|
}.bind(this) |
|
|
|
} |
|
|
|
|
|
|
|
this.master.on('setParam', this.setParam.bind(this)) |
|
|
|
this.master.on('applyParam', this.applyParam.bind(this)) |
|
|
|
this.master.on('applyParam', (param) => { |
|
|
|
this.applyParam(param) |
|
|
|
|
|
|
|
if (!this.tabFilter.isSelected()) { |
|
|
|
this.tabFilter.select() |
|
|
|
} |
|
|
|
}) |
|
|
|
this.master.on('open', this.openCategory.bind(this)) |
|
|
|
this.master.on('stateGet', this.stateGet.bind(this)) |
|
|
|
} |
|
|
@ -227,6 +233,15 @@ 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) { |
|
|
@ -244,6 +259,9 @@ class CategoryOverpassFilter { |
|
|
|
|
|
|
|
openCategory () { |
|
|
|
this.formFilter.resize() |
|
|
|
|
|
|
|
let param = JSON.parse(JSON.stringify(this.formFilter.get_data())) |
|
|
|
this.applyParam(param) |
|
|
|
} |
|
|
|
|
|
|
|
stateGet (param) { |
|
|
|