web: always show bulk-edit checkbox, fix check logic
This commit is contained in:
parent
d84957cc8c
commit
4a6b159ddb
@ -468,38 +468,42 @@ fn search_toolbar(
|
|||||||
if let Some(tri) = tri.get() {
|
if let Some(tri) = tri.get() {
|
||||||
tri.set_indeterminate(indeterminate);
|
tri.set_indeterminate(indeterminate);
|
||||||
}
|
}
|
||||||
|
let catchup = div![button![
|
||||||
|
tw_classes::button(),
|
||||||
|
attrs! {At::Title => "Catch up"},
|
||||||
|
span![i![C!["far", "fa-eye"]]],
|
||||||
|
span![C!["pl-2", "hidden", "md:inline"], "Catch-up"],
|
||||||
|
ev(Ev::Click, |_| Msg::CatchupStart)
|
||||||
|
]];
|
||||||
|
let tristate_input = div![
|
||||||
|
C!["flex", "items-center", "mr-4"],
|
||||||
|
input![
|
||||||
|
&tri,
|
||||||
|
C![&tw_classes::CHECKBOX],
|
||||||
|
attrs! {
|
||||||
|
At::Type=>"checkbox",
|
||||||
|
},
|
||||||
|
IF!(all_selected=>attrs!{At::Checked=>true})
|
||||||
|
],
|
||||||
|
ev(Ev::Input, move |_| {
|
||||||
|
if all_selected {
|
||||||
|
Msg::SelectionSetNone
|
||||||
|
} else {
|
||||||
|
Msg::SelectionSetAll
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
];
|
||||||
nav![
|
nav![
|
||||||
C!["py-4", "flex", "w-full", "justify-between"],
|
C!["py-4", "flex", "w-full", "justify-between"],
|
||||||
div![
|
div![
|
||||||
C!["gap-2", "flex", IF!(show_bulk_edit => "hidden")],
|
C!["gap-2", "flex", IF!(show_bulk_edit => "hidden")],
|
||||||
div![button![
|
&tristate_input,
|
||||||
tw_classes::button(),
|
&catchup
|
||||||
attrs! {At::Title => "Mark as read"},
|
|
||||||
span![i![C!["far", "fa-eye"]]],
|
|
||||||
span![C!["pl-2", "hidden", "md:inline"], "Catch-up"],
|
|
||||||
ev(Ev::Click, |_| Msg::CatchupStart)
|
|
||||||
]],
|
|
||||||
],
|
],
|
||||||
div![
|
div![
|
||||||
C!["gap-2", "flex", IF!(!show_bulk_edit => "hidden")],
|
C!["gap-2", "flex", IF!(!show_bulk_edit => "hidden")],
|
||||||
div![
|
&tristate_input,
|
||||||
C!["flex", "items-center", "mr-4"],
|
&catchup,
|
||||||
input![
|
|
||||||
tri,
|
|
||||||
C![&tw_classes::CHECKBOX],
|
|
||||||
attrs! {
|
|
||||||
At::Type=>"checkbox",
|
|
||||||
At::Checked=>all_selected,
|
|
||||||
}
|
|
||||||
],
|
|
||||||
ev(Ev::Input, move |_| {
|
|
||||||
if all_selected {
|
|
||||||
Msg::SelectionSetNone
|
|
||||||
} else {
|
|
||||||
Msg::SelectionSetAll
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
],
|
|
||||||
div![
|
div![
|
||||||
button![
|
button![
|
||||||
tw_classes::button(),
|
tw_classes::button(),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user