forked from MapComplete/MapComplete
Cleaning filtered layer
This commit is contained in:
parent
8e5e249e6b
commit
314894085a
12 changed files with 232 additions and 280 deletions
|
@ -27,24 +27,25 @@ export default class EditableTagRendering extends UIElement {
|
|||
this.ListenTo(this._editMode);
|
||||
this.ListenTo(State.state?.osmConnection?.userDetails)
|
||||
|
||||
const self = this;
|
||||
|
||||
this._answer = new TagRenderingAnswer(tags, configuration);
|
||||
|
||||
this._answer.SetStyle("width:100%;")
|
||||
|
||||
if (this._configuration.question !== undefined) {
|
||||
// 2.3em total width
|
||||
if(State.state.featureSwitchUserbadge.data){
|
||||
|
||||
this._editButton =
|
||||
Svg.pencil_svg().SetClass("edit-button")
|
||||
.onClick(() => {
|
||||
self._editMode.setData(true);
|
||||
});
|
||||
if (State.state.featureSwitchUserbadge.data) {
|
||||
// 2.3em total width
|
||||
const self = this;
|
||||
this._editButton =
|
||||
Svg.pencil_svg().SetClass("edit-button")
|
||||
.onClick(() => {
|
||||
self._editMode.setData(true);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private GenerateQuestion() {
|
||||
const self = this;
|
||||
if (this._configuration.question !== undefined) {
|
||||
// And at last, set up the skip button
|
||||
const cancelbutton =
|
||||
Translations.t.general.cancel.Clone()
|
||||
|
@ -53,7 +54,7 @@ export default class EditableTagRendering extends UIElement {
|
|||
self._editMode.setData(false)
|
||||
});
|
||||
|
||||
this._question = new TagRenderingQuestion(tags, configuration,
|
||||
return new TagRenderingQuestion(this._tags, this._configuration,
|
||||
() => {
|
||||
self._editMode.setData(false)
|
||||
},
|
||||
|
@ -65,6 +66,7 @@ export default class EditableTagRendering extends UIElement {
|
|||
InnerRender(): string {
|
||||
|
||||
if (this._editMode.data) {
|
||||
this._question = this.GenerateQuestion();
|
||||
return this._question.Render();
|
||||
}
|
||||
|
||||
|
|
|
@ -118,7 +118,6 @@ export default class TagRenderingQuestion extends UIElement {
|
|||
const inputEl = new InputElementMap<number[], TagsFilter>(
|
||||
checkBoxes,
|
||||
(t0, t1) => {
|
||||
console.log("IsEquiv?",t0, t1, t0?.isEquivalent(t1))
|
||||
return t0?.isEquivalent(t1) ?? false
|
||||
},
|
||||
(indices) => {
|
||||
|
@ -162,8 +161,6 @@ export default class TagRenderingQuestion extends UIElement {
|
|||
}
|
||||
|
||||
}
|
||||
console.log(indices, freeformExtras);
|
||||
|
||||
if (freeformField) {
|
||||
if (freeformExtras.length > 0) {
|
||||
freeformField.GetValue().setData(new Tag(this._configuration.freeform.key, freeformExtras.join(";")));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue