Skip to content

Commit

Permalink
Improved mobile accessibility.
Browse files Browse the repository at this point in the history
  • Loading branch information
vaijira committed Dec 21, 2024
1 parent ff6765a commit 4646c39
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<header><h1>Generaci&oacute;n del modelo 720 a partir de los informes de Interactive brokers y Degiro.</h1></header>
<main class="container">
<div class="item">
<div id="burocratinApp" ><script src="js/index.js"></script></div>
<div id="burocratinApp" ><script src="js/index.js"></script><svg alt="loading" height="800px" width="600px"></svg></div>
</div>
<div class="item">
<div class="faq">
Expand Down
6 changes: 5 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ pub async fn main_js() -> Result<(), JsValue> {

let app = App::new();

dominator::append_dom(&dominator::get_id("burocratinApp"), App::render(app));
dominator::replace_dom(
&dominator::get_id("burocratinApp"),
&dominator::get_id("burocratinApp").last_child().unwrap(),
App::render(app),
);

Ok(())
}
5 changes: 5 additions & 0 deletions src/personal_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ impl PersonalInfoViewer {
.attr("type", "text")
.attr("autocomplete", "given-name")
.attr("placeholder", "Nombre")
.style("height", "24px")
.with_node!(element => {
.event(clone!(this => move |_: events::Input| {
this.personal_info.lock_mut().name = element.value().to_uppercase();
Expand All @@ -47,6 +48,7 @@ impl PersonalInfoViewer {
.attr("type", "text")
.attr("autocomplete", "family-name")
.attr("placeholder", "Apellidos")
.style("height", "24px")
.with_node!(element => {
.event(clone!(this => move |_: events::Input| {
this.personal_info.lock_mut().surname = element.value().to_uppercase();
Expand All @@ -64,6 +66,7 @@ impl PersonalInfoViewer {
.attr("type", "text")
.attr("max-length", "9")
.attr("placeholder", "DNI con letra")
.style("height", "24px")
.with_node!(element => {
.event(clone!(this => move |_: events::Input| {
this.personal_info.lock_mut().nif = element.value().to_uppercase();
Expand All @@ -82,6 +85,7 @@ impl PersonalInfoViewer {
.attr("maxlength", "4")
.attr("placeholder", "Año")
.attr("value", &DEFAULT_YEAR.to_string())
.style("height", "24px")
.with_node!(element => {
.event(clone!(this => move |_: events::Input| {
this.personal_info.lock_mut().year = element.value().parse::<usize>().unwrap_or(DEFAULT_YEAR);
Expand All @@ -100,6 +104,7 @@ impl PersonalInfoViewer {
.attr("autocomplete", "tel")
.attr("maxlength", "9")
.attr("placeholder", "Teléfono")
.style("height", "24px")
.with_node!(element => {
.event(clone!(this => move |_: events::Input| {
this.personal_info.lock_mut().phone = element.value().to_uppercase();
Expand Down
3 changes: 3 additions & 0 deletions src/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ impl Table {
.map(|header_cell| {
html!("th", {
.attr("scope", "col")
.attr("role", "columnheader")
.style("vertical-align", "bottom")
.style("font-weight", "bold")
.style("background-color", "#ddd")
Expand All @@ -143,6 +144,7 @@ impl Table {
.child(
html!("th", {
.attr("scope", "col")
.attr("role", "columnheader")
.style("vertical-align", "bottom")
.style("font-weight", "bold")
.style("background-color", "#ddd")
Expand All @@ -153,6 +155,7 @@ impl Table {
.child(
html!("th", {
.attr("scope", "col")
.attr("role", "columnheader")
.style("vertical-align", "bottom")
.style("font-weight", "bold")
.style("background-color", "#ddd")
Expand Down

0 comments on commit 4646c39

Please sign in to comment.