mirror of
https://github.com/DioxusLabs/dioxus
synced 2024-11-10 14:44:12 +00:00
chore: clean up zoom example
This commit is contained in:
parent
a13b69788b
commit
972084ee32
1 changed files with 4 additions and 3 deletions
|
@ -14,9 +14,10 @@ fn app(cx: Scope) -> Element {
|
||||||
r#type: "number",
|
r#type: "number",
|
||||||
value: "{level}",
|
value: "{level}",
|
||||||
oninput: |e| {
|
oninput: |e| {
|
||||||
let new_zoom = e.value.parse::<f64>().unwrap_or(1.0);
|
if let Ok(new_zoom) = e.value.parse::<f64>() {
|
||||||
level.set(new_zoom);
|
level.set(new_zoom);
|
||||||
window.webview.zoom(new_zoom);
|
window.webview.zoom(new_zoom);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue