forked from MapComplete/MapComplete
Merge branch 'develop' into feature/conflation-fix
This commit is contained in:
commit
7f99e76b0c
6 changed files with 56 additions and 16 deletions
|
@ -59,7 +59,7 @@ export class And extends TagsFilter {
|
|||
}
|
||||
|
||||
asHumanString(linkToWiki: boolean, shorten: boolean, properties) {
|
||||
return this.and.map(t => t.asHumanString(linkToWiki, shorten, properties)).join("&");
|
||||
return this.and.map(t => t.asHumanString(linkToWiki, shorten, properties)).filter(x => x !== "").join("&");
|
||||
}
|
||||
|
||||
isUsableAsAnswer(): boolean {
|
||||
|
|
|
@ -48,7 +48,7 @@ export class Tag extends TagsFilter {
|
|||
}
|
||||
if(v === "" || v === undefined){
|
||||
// This tag will be removed if in the properties, so we indicate this with special rendering
|
||||
if(currentProperties !== undefined && (currentProperties[this.key] ?? "") !== ""){
|
||||
if(currentProperties !== undefined && (currentProperties[this.key] ?? "") === ""){
|
||||
// This tag is not present in the current properties, so this tag doesn't change anything
|
||||
return ""
|
||||
}
|
||||
|
|
|
@ -281,10 +281,12 @@ export class UIEventSource<T> {
|
|||
* @param f: The transforming function
|
||||
* @param extraSources: also trigger the update if one of these sources change
|
||||
* @param g: a 'backfunction to let the sync run in two directions. (data of the new UIEVEntSource, currentData) => newData
|
||||
* @param allowUnregister: if set, the update will be halted if no listeners are registered
|
||||
*/
|
||||
public map<J>(f: ((t: T) => J),
|
||||
extraSources: UIEventSource<any>[] = [],
|
||||
g: ((j: J, t: T) => T) = undefined): UIEventSource<J> {
|
||||
g: ((j: J, t: T) => T) = undefined,
|
||||
allowUnregister = false): UIEventSource<J> {
|
||||
const self = this;
|
||||
|
||||
const stack = new Error().stack.split("\n");
|
||||
|
@ -297,6 +299,7 @@ export class UIEventSource<T> {
|
|||
|
||||
const update = function () {
|
||||
newSource.setData(f(self.data));
|
||||
return allowUnregister && newSource._callbacks.length === 0
|
||||
}
|
||||
|
||||
this.addCallback(update);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue