modal supports editing name and value
This commit is contained in:
parent
6f9142b046
commit
fb9a809c02
|
@ -48,11 +48,22 @@ def generic_list_editor(title, element_list_getter):
|
||||||
return content
|
return content
|
||||||
|
|
||||||
def homonymy_editor(title, current_labels):
|
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)]
|
content = [h("p", {}, title)]
|
||||||
for i, feature in enumerate(current_labels()):
|
for i, feature in enumerate(current_labels()):
|
||||||
console.log(feature)
|
console.log(feature)
|
||||||
content.append(h("label", {"props": {"value": "Name", "for": i}}))
|
console.log(feature["name"])
|
||||||
content.append(h("input.list-adder-input", {"props": {"type": "text", "value": feature["name"], "id": i}}, ""))
|
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)}}, "+"))
|
content.append(h("button", {"on": {"click": message.msg(message.AddToGenericList, current_labels)}}, "+"))
|
||||||
|
|
||||||
return content
|
return content
|
||||||
|
|
Loading…
Reference in New Issue
Block a user