Skip to content

Commit

Permalink
fixes for PDF context menu (logseq#7690)
Browse files Browse the repository at this point in the history
* fix(pdf): do not hide ctx menu when its blank area is clicked
* fix: ensure ctx menu is shown when text is selected
  • Loading branch information
situ2001 authored Dec 15, 2022
1 parent 07a7368 commit 6237399
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/main/frontend/extensions/pdf/highlights.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@
{:ref *el
:style {:top top :left left :visibility (if (and @*highlight-mode? new?) "hidden" "visible")}
:on-click (fn [^js/MouseEvent e]
(.stopPropagation e)
(when-let [action (.. e -target -dataset -action)]
(action-fn! action true)))}

Expand Down Expand Up @@ -599,9 +600,10 @@
:properties {}})))]

;; show ctx menu
(set-tip-state! {:highlight hl-fn
:selection selection
:point point}))))
(js/setTimeout (fn []
(set-tip-state! {:highlight hl-fn
:selection selection
:point point})))) 0))

[(:range sel-state)])

Expand Down

0 comments on commit 6237399

Please sign in to comment.