modal supports editing name and value

mt-homonymy-support
matic_t 4 years ago
parent 6f9142b046
commit fb9a809c02

@ -48,11 +48,22 @@ def generic_list_editor(title, element_list_getter):
return content
def homonymy_editor(title, current_labels):
def split_line2(left, right):
cls = "flex.two{}".format(".label-list-row")
return h("div.{}".format(cls), {}, [
h("span.half", {}, left), h("span.half", {}, right)])
content = [h("p", {}, title)]
for i, feature in enumerate(current_labels()):
console.log(feature)
content.append(h("label", {"props": {"value": "Name", "for": i}}))
content.append(h("input.list-adder-input", {"props": {"type": "text", "value": feature["name"], "id": i}}, ""))
console.log(feature["name"])
name = [h("div", {})]
value = [h("div", {})]
name.append(h("label", {"attrs": {"for": i}}, "Name:"))
name.append(h("input.list-adder-input", {"props": {"type": "text", "value": feature["name"], "id": i}}, ""))
value.append(h("label", {"attrs": {"for": i + "-value"}}, "Value:"))
value.append(h("input.list-adder-input", {"props": {"type": "text", "value": feature["value"], "id": i + "-value"}}, ""))
content.append(split_line2(name, value))
content.append(h("button", {"on": {"click": message.msg(message.AddToGenericList, current_labels)}}, "+"))
return content

Loading…
Cancel
Save