enhance(mobile): clickable link item for the left sidebar item

This commit is contained in:
charlie
2025-08-10 11:33:28 +08:00
parent 5e6e5596aa
commit 059261c63c
3 changed files with 13 additions and 7 deletions

View File

@@ -135,16 +135,17 @@
;; TODO: move to standalone component
[:a.link-item.group
(cond->
{:on-click
{(if (util/mobile?)
:on-pointer-up :on-click)
(fn [e]
(if (gobj/get e "shiftKey")
(open-in-sidebar)
(route-handler/redirect-to-page! (:block/uuid page) {:click-from-recent? recent?})))
:on-context-menu (fn [^js e]
(shui/popup-show! e (x-menu-content)
{:as-dropdown? true
:content-props {:on-click (fn [] (shui/popup-hide!))
:class "w-60"}})
{:as-dropdown? true
:content-props {:on-click (fn [] (shui/popup-hide!))
:class "w-60"}})
(util/stop e))}
(ldb/object? page)
(assoc :title (block-handler/block-unique-title page)))

View File

@@ -81,6 +81,10 @@ ul {
}
}
a, button {
-webkit-tap-highlight-color: transparent;
}
.bg-background {
@apply bg-gray-01;
}

View File

@@ -23,8 +23,9 @@
[:div.w-full.app-silk-popup-content-inner.p-2
[:div.left-sidebar-inner
[:div.sidebar-contents-container.mt-8
{:on-click (fn [^js e]
(when (some-> (.-target e) (.closest ".link-item"))
(mobile-state/toggle-left-sidebar!)))}
{:on-pointer-down
(fn [^js e]
(when (some-> (.-target e) (.closest ".link-item"))
(mobile-state/toggle-left-sidebar!)))}
(container/sidebar-favorites)
(container/sidebar-recent-pages)]]]))))))