From 46882caea0444a71dddaf270300d98e066b52b5d Mon Sep 17 00:00:00 2001 From: spinline Date: Sun, 8 Feb 2026 20:47:42 +0300 Subject: [PATCH] =?UTF-8?q?fix:=20mobilde=20men=C3=BClerin=20a=C3=A7=C4=B1?= =?UTF-8?q?lmama=20sorunu=20HTML=20details/summary=20yap=C4=B1s=C4=B1=20il?= =?UTF-8?q?e=20k=C3=B6kten=20=C3=A7=C3=B6z=C3=BCld=C3=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/Cargo.toml | 28 +------ frontend/src/components/layout/statusbar.rs | 90 +++++++-------------- 2 files changed, 30 insertions(+), 88 deletions(-) diff --git a/frontend/Cargo.toml b/frontend/Cargo.toml index e4d556b..c63de11 100644 --- a/frontend/Cargo.toml +++ b/frontend/Cargo.toml @@ -22,33 +22,7 @@ wasm-bindgen-futures = "0.4" uuid = { version = "1", features = ["v4", "js"] } futures = "0.3" chrono = { version = "0.4", features = ["serde", "wasm-bindgen"] } -web-sys = { version = "0.3", features = [ - "HtmlDivElement", - "HtmlUListElement", - "HtmlLiElement", - "HtmlAnchorElement", - "MouseEvent", - "Event", - "Window", - "Document", - "Element", - "DomTokenList", - "CssStyleDeclaration", - "Storage", - "TouchEvent", - "TouchList", - "Touch", - "Navigator", - "Notification", - "NotificationOptions", - "NotificationPermission", - "ServiceWorkerContainer", - "ServiceWorkerRegistration", - "PushManager", - "PushSubscription", - "PushSubscriptionOptions", - "PushSubscriptionOptionsInit" -] } +web-sys = { version = "0.3", features = ["HtmlDivElement", "HtmlUListElement", "HtmlLiElement", "HtmlAnchorElement", "MouseEvent", "Event", "Window", "Document", "Element", "DomTokenList", "CssStyleDeclaration", "Storage", "TouchEvent", "TouchList", "Touch", "Navigator", "Notification", "NotificationOptions", "NotificationPermission", "ServiceWorkerContainer", "ServiceWorkerRegistration", "PushManager", "PushSubscription", "PushSubscriptionOptions", "PushSubscriptionOptionsInit", "HtmlDetailsElement"] } shared = { path = "../shared" } tailwind_fuse = "0.3.2" js-sys = "0.3.85" diff --git a/frontend/src/components/layout/statusbar.rs b/frontend/src/components/layout/statusbar.rs index 68e500b..48f4a61 100644 --- a/frontend/src/components/layout/statusbar.rs +++ b/frontend/src/components/layout/statusbar.rs @@ -97,43 +97,28 @@ pub fn StatusBar() -> impl IntoView { }); }; - // Signal-based dropdown state: 0=none, 1=download, 2=upload, 3=theme - let (active_dropdown, set_active_dropdown) = create_signal(0u8); + // Refs for click outside detection + let down_details_ref = create_node_ref::(); + let up_details_ref = create_node_ref::(); + let theme_details_ref = create_node_ref::(); - // Toggle a specific dropdown - let toggle = move |id: u8| { - let current = active_dropdown.get_untracked(); - if current == id { - set_active_dropdown.set(0); - } else { - set_active_dropdown.set(id); + // Helper to close a details element + let close_details = |node_ref: NodeRef| { + if let Some(el) = node_ref.get_untracked() { + el.set_open(false); } }; - // Close all dropdowns - let close_all = move || { - set_active_dropdown.set(0); - }; - - // Refs for click outside detection - let down_ref = create_node_ref::(); - let up_ref = create_node_ref::(); - let theme_ref = create_node_ref::(); - - let _ = on_click_outside(down_ref, move |_| if active_dropdown.get_untracked() == 1 { close_all() }); - let _ = on_click_outside(up_ref, move |_| if active_dropdown.get_untracked() == 2 { close_all() }); - let _ = on_click_outside(theme_ref, move |_| if active_dropdown.get_untracked() == 3 { close_all() }); + let _ = on_click_outside(down_details_ref, move |_| close_details(down_details_ref)); + let _ = on_click_outside(up_details_ref, move |_| close_details(up_details_ref)); + let _ = on_click_outside(theme_details_ref, move |_| close_details(theme_details_ref)); view! {
// --- DOWNLOAD SPEED DROPDOWN --- -
-
+
+ -
+ // --- UPLOAD SPEED DROPDOWN --- -
-
+
+ -
+
-
-
+
+ -
+