web: remove dead code
This commit is contained in:
parent
4b8923d852
commit
66e8e00a9b
@ -57,25 +57,6 @@ pub fn init(url: Url, orders: &mut impl Orders<Msg>) -> Model {
|
||||
}
|
||||
}
|
||||
|
||||
fn compute_scroll_ratio() -> Msg {
|
||||
// TODO: compute completion based on contents of the post, not the overall body (which includes
|
||||
// the tags at the end on mobile/tablet).
|
||||
let body = document().body().expect("body");
|
||||
let sh = body.scroll_height() as f64;
|
||||
// HACK: don't report percent until a fixed amount of scrolling has happened
|
||||
let sh = if sh < 400. { 0. } else { sh };
|
||||
let window = window();
|
||||
let ih = window
|
||||
.inner_height()
|
||||
.expect("window height")
|
||||
.unchecked_into::<js_sys::Number>()
|
||||
.value_of();
|
||||
let scroll_y = window.scroll_y().expect("scroll Y");
|
||||
|
||||
let end = sh - ih;
|
||||
let ratio = scroll_y / end;
|
||||
Msg::SetProgress(ratio)
|
||||
}
|
||||
fn on_url_changed(uc: subs::UrlChanged) -> Msg {
|
||||
let mut url = uc.0;
|
||||
info!(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user