mirror of
https://github.com/storytold/storyteller-bevy.git
synced 2026-10-18 00:23:14 +00:00
Worked changing for trivial
This commit is contained in:
@@ -17,6 +17,7 @@ function unpack_vnode(
|
||||
element.setAttribute(attr[0], attr[1]);
|
||||
}
|
||||
element.setAttribute("onchange_id", node_data["onchange"]);
|
||||
console.log("onchange", node_data["onchange"]);
|
||||
//apply children
|
||||
if (node_data["children"] != undefined) {
|
||||
for (var j = 0; j < node_data["children"].length; j++) {
|
||||
@@ -28,9 +29,10 @@ function unpack_vnode(
|
||||
//add onchange hook if input
|
||||
if (node_data["tag"] == "input") {
|
||||
element.onchange = (event: Event) => {
|
||||
const input = event.target as HTMLInputElement;
|
||||
var input = event.target as HTMLInputElement;
|
||||
const id = input.getAttribute("onchange_id");
|
||||
if (id) {
|
||||
if (id != null) {
|
||||
console.log("onchange", id, input.value);
|
||||
const value = input.value;
|
||||
register_new_change(id, value);
|
||||
}
|
||||
|
||||
@@ -126,7 +126,7 @@ fn check_predefined(r : &dyn Reflect, onchange : ReflectChange) -> Option<VNode>
|
||||
("value".to_string(), vec.x.to_string()),
|
||||
],
|
||||
children: vec![],
|
||||
onchange: None
|
||||
onchange: Some(onchange.add_path("x").to_string())
|
||||
}),
|
||||
VNode::Text("Y: ".to_string()),
|
||||
VNode::Component(VComponent {
|
||||
@@ -136,7 +136,7 @@ fn check_predefined(r : &dyn Reflect, onchange : ReflectChange) -> Option<VNode>
|
||||
("value".to_string(), vec.y.to_string()),
|
||||
],
|
||||
children: vec![],
|
||||
onchange: None
|
||||
onchange: Some(onchange.add_path("y").to_string())
|
||||
}),
|
||||
VNode::Text("Z: ".to_string()),
|
||||
VNode::Component(VComponent {
|
||||
@@ -146,7 +146,7 @@ fn check_predefined(r : &dyn Reflect, onchange : ReflectChange) -> Option<VNode>
|
||||
("value".to_string(), vec.z.to_string()),
|
||||
],
|
||||
children: vec![],
|
||||
onchange: None
|
||||
onchange: Some(onchange.add_path("z").to_string())
|
||||
})
|
||||
],
|
||||
onchange: None
|
||||
|
||||
Reference in New Issue
Block a user