Compare commits
1 Commits
release-20
...
release-20
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
275bb6e37a |
@@ -339,6 +339,14 @@ pub fn TorrentTable() -> impl IntoView {
|
||||
</div>
|
||||
|
||||
<div class="md:hidden flex flex-col h-full bg-base-200 relative">
|
||||
// Transparent overlay to close sort dropdown
|
||||
<Show when=move || sort_open.get()>
|
||||
<div
|
||||
class="fixed inset-0 z-[98] cursor-default"
|
||||
on:pointerdown=move |_| set_sort_open.set(false)
|
||||
></div>
|
||||
</Show>
|
||||
|
||||
<div class="px-3 py-2 border-b border-base-200 flex justify-between items-center bg-base-100/95 backdrop-blur z-10 shrink-0">
|
||||
<span class="text-xs font-bold opacity-50 uppercase tracking-wider">"Torrents"</span>
|
||||
|
||||
@@ -360,6 +368,7 @@ pub fn TorrentTable() -> impl IntoView {
|
||||
<ul
|
||||
class="absolute top-full right-0 z-[100] menu p-2 shadow bg-base-100 rounded-box w-48 mt-1 border border-base-200 text-xs"
|
||||
style=move || if sort_open.get() { "display: block" } else { "display: none" }
|
||||
on:pointerdown=move |e| e.stop_propagation()
|
||||
>
|
||||
<li class="menu-title px-2 py-1 opacity-50 text-[10px] uppercase font-bold">"Sort By"</li>
|
||||
{
|
||||
@@ -374,21 +383,20 @@ pub fn TorrentTable() -> impl IntoView {
|
||||
(SortColumn::AddedDate, "Date"),
|
||||
];
|
||||
|
||||
columns.into_iter().map(|(col, label)| {
|
||||
let is_active = move || sort_col.get() == col;
|
||||
let current_dir = move || sort_dir.get();
|
||||
columns.into_iter().map(|(col, label)| {
|
||||
let is_active = move || sort_col.get() == col;
|
||||
let current_dir = move || sort_dir.get();
|
||||
|
||||
view! {
|
||||
<li>
|
||||
<button
|
||||
type="button"
|
||||
class=move || if is_active() { "bg-primary/10 text-primary font-bold flex justify-between" } else { "flex justify-between" }
|
||||
on:pointerdown=move |e| {
|
||||
e.stop_propagation();
|
||||
handle_sort(col);
|
||||
set_sort_open.set(false);
|
||||
}
|
||||
>
|
||||
view! {
|
||||
<li>
|
||||
<button
|
||||
class=move || if is_active() { "bg-primary/10 text-primary font-bold flex justify-between" } else { "flex justify-between" }
|
||||
on:pointerdown=move |e| {
|
||||
e.stop_propagation();
|
||||
handle_sort(col);
|
||||
set_sort_open.set(false);
|
||||
}
|
||||
>
|
||||
{label}
|
||||
<Show when=is_active fallback=|| ()>
|
||||
<span class="opacity-70 text-[10px]">
|
||||
|
||||
Reference in New Issue
Block a user