(&self)
| 100 | } |
| 101 | |
| 102 | fn view(&self) -> Html { |
| 103 | html! { |
| 104 | <div> |
| 105 | <input type="file" name="image-upload" id="image-upload" value="" onchange=self.link.callback(move |value| { |
| 106 | let mut result = Vec::new(); |
| 107 | if let ChangeData::Files(files) = value { |
| 108 | let files = js_sys::try_iter(&files) |
| 109 | .unwrap() |
| 110 | .unwrap() |
| 111 | .into_iter() |
| 112 | .map(|v| File::from(v.unwrap())); |
| 113 | result.extend(files); |
| 114 | } |
| 115 | Msg::LoadFile(result) |
| 116 | }) /> |
| 117 | <br /> |
| 118 | <button id="shrink" onclick=self.link.callback(move |_| { Msg::Shrink })>{ "Shrink" }</button> |
| 119 | <br / > |
| 120 | <canvas id="preview"></canvas> |
| 121 | </div> |
| 122 | } |
| 123 | } |
| 124 | } |
nothing calls this directly
no outgoing calls
no test coverage detected