New close icon, fix #58, small tweaks to buurtnatuur quests

This commit is contained in:
Pieter Vander Vennet 2020-07-24 14:46:25 +02:00
parent fac7aec20b
commit 7bbc140f05
18 changed files with 180 additions and 72 deletions

View file

@ -10,7 +10,7 @@ export class DropDown<T> extends InputElement<T> {
private readonly _label: UIElement;
private readonly _values: { value: T; shown: UIElement }[];
private readonly _value;
private readonly _value : UIEventSource<T>;
constructor(label: string | UIElement,
values: { value: T, shown: string | UIElement }[],
@ -75,8 +75,6 @@ export class DropDown<T> extends InputElement<T> {
}
protected InnerUpdate(element) {
var e = document.getElementById("dropdown-" + this.id);
if(e === null){
return;
@ -86,13 +84,13 @@ export class DropDown<T> extends InputElement<T> {
// @ts-ignore
var index = parseInt(e.selectedIndex);
self._value.setData(self._values[index].value);
});
var t = this._value.data;
for (let i = 0; i < this._values.length ; i++) {
const value = this._values[i];
if (value.value == t) {
const value = this._values[i].value;
console.log("Checking",value," against ",t, ":", t === value)
if (value === t) {
// @ts-ignore
e.selectedIndex = i;
}

View file

@ -2,6 +2,7 @@ import { UIElement } from "./UIElement";
import { FilteredLayer } from "../Logic/FilteredLayer";
import { CheckBox } from "./Input/CheckBox";
import Combine from "./Base/Combine";
import {Utils} from "../Utils";
export class LayerSelection extends UIElement{