Load more fixes
This commit is contained in:
@@ -837,14 +837,18 @@ async fn ListDB<G: Html>(cx: Scope<'_>) -> View<G> {
|
|||||||
|
|
||||||
let handle_load_more = move |_| {
|
let handle_load_more = move |_| {
|
||||||
let app_state = app_state.clone();
|
let app_state = app_state.clone();
|
||||||
app_state.scrollevent.set(true);
|
if *app_state.scrolling.get() == true {
|
||||||
|
app_state.scrollevent.set(true);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
let callback: Closure<dyn FnMut()> = Closure::new(move || {
|
let callback: Closure<dyn FnMut()> = Closure::new(move || {
|
||||||
//let csignal = csignal.clone();
|
//let csignal = csignal.clone();
|
||||||
//csignal.set(true);
|
//csignal.set(true);
|
||||||
let app_state2 = app_state2.clone();
|
let app_state2 = app_state2.clone();
|
||||||
app_state2.scrollevent.set(true);
|
if *app_state2.scrolling.get() == true {
|
||||||
|
app_state2.scrollevent.set(true);
|
||||||
|
}
|
||||||
info!("Got scroll event");
|
info!("Got scroll event");
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -874,6 +878,15 @@ async fn ListDB<G: Html>(cx: Scope<'_>) -> View<G> {
|
|||||||
},
|
},
|
||||||
key =|x| x.id )
|
key =|x| x.id )
|
||||||
}
|
}
|
||||||
|
br{}
|
||||||
|
(if *app_state.maxpage.get() > 1 && *app_state.maxpage.get() > *app_state.pagedisplay.get() {
|
||||||
|
view!{ cx,
|
||||||
|
div(class="flex flex-col items-center"){
|
||||||
|
button(class="bg-gray-300 hover:bg-gray-400 text-gray-800 font-bold py-2 px-4 rounded inline-flex items-center",on:click=handle_load_more){ "Load More" }
|
||||||
|
}
|
||||||
|
}} else {
|
||||||
|
view!{ cx, ""}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if *app_state.openlibrary.get() == false && *app_state.editmode.get() == true {
|
} else if *app_state.openlibrary.get() == false && *app_state.editmode.get() == true {
|
||||||
@@ -887,21 +900,22 @@ async fn ListDB<G: Html>(cx: Scope<'_>) -> View<G> {
|
|||||||
},
|
},
|
||||||
key =|x| x.id )
|
key =|x| x.id )
|
||||||
}
|
}
|
||||||
|
br{}
|
||||||
|
(if *app_state.maxpage.get() > 1 && *app_state.maxpage.get() > *app_state.pagedisplay.get() {
|
||||||
|
view!{ cx,
|
||||||
|
div(class="flex flex-col items-center"){
|
||||||
|
button(class="bg-gray-300 hover:bg-gray-400 text-gray-800 font-bold py-2 px-4 rounded inline-flex items-center",on:click=handle_load_more){ "Load More" }
|
||||||
|
}
|
||||||
|
}} else {
|
||||||
|
view!{ cx, ""}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
view!{cx, ""}
|
view!{cx, ""}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
br{}
|
|
||||||
(if *app_state.maxpage.get() > 1 && *app_state.maxpage.get() > *app_state.pagedisplay.get() {
|
|
||||||
view!{ cx,
|
|
||||||
div(class="flex flex-col items-center"){
|
|
||||||
button(class="bg-gray-300 hover:bg-gray-400 text-gray-800 font-bold py-2 px-4 rounded inline-flex items-center",on:click=handle_load_more){ "Load More" }
|
|
||||||
}
|
|
||||||
}} else {
|
|
||||||
view!{ cx, ""}
|
|
||||||
})
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user