mirror of
https://gitlab.kit.edu/uskyk/kv.git
synced 2024-11-21 08:25:00 +00:00
Make number of voriables instant apply
This commit is contained in:
parent
38a5d2d36d
commit
06a1d808de
@ -40,7 +40,7 @@
|
|||||||
<div><h1>KV diagram calculator</h1><a href="https://gitlab.kit.edu/uskyk/kv">(source code)</a></div>
|
<div><h1>KV diagram calculator</h1><a href="https://gitlab.kit.edu/uskyk/kv">(source code)</a></div>
|
||||||
<div id="main">
|
<div id="main">
|
||||||
<div id="settings">
|
<div id="settings">
|
||||||
<label>Number of variables: <input type="number" min="1" value="3" id="variables"></label><button id="apply-variables">Apply</button>
|
<label>Number of variables: <input type="number" min="1" value="3" id="variables"></label>
|
||||||
</div>
|
</div>
|
||||||
<p id="hints">
|
<p id="hints">
|
||||||
Change output specification by scrolling (up => 1, down => 0), typing (=> 1, 0) or deleting (=> -).
|
Change output specification by scrolling (up => 1, down => 0), typing (=> 1, 0) or deleting (=> -).
|
||||||
|
@ -174,9 +174,9 @@ fn init_settings() {
|
|||||||
let closure = Closure::wrap(Box::new(|| run()) as Box<dyn FnMut()>);
|
let closure = Closure::wrap(Box::new(|| run()) as Box<dyn FnMut()>);
|
||||||
calculate.add_event_listener_with_callback("click", closure.as_ref().unchecked_ref()).unwrap();
|
calculate.add_event_listener_with_callback("click", closure.as_ref().unchecked_ref()).unwrap();
|
||||||
closure.forget();
|
closure.forget();
|
||||||
let apply_count = web!(document).get_element_by_id("apply-variables").unwrap().unchecked_into::<EventTarget>();
|
let count = web!(document).get_element_by_id("variables").unwrap().unchecked_into::<EventTarget>();
|
||||||
let closure = Closure::wrap(Box::new(|| update_input_grid(&grid(get_var_number()))) as Box<dyn FnMut()>);
|
let closure = Closure::wrap(Box::new(|| update_input_grid(&grid(get_var_number()))) as Box<dyn FnMut()>);
|
||||||
apply_count.add_event_listener_with_callback("click", closure.as_ref().unchecked_ref()).unwrap();
|
count.add_event_listener_with_callback("change", closure.as_ref().unchecked_ref()).unwrap();
|
||||||
closure.forget();
|
closure.forget();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user