mirror of https://github.com/logseq/logseq
fix: open error external link with shiftkey on Win #2023
parent
907704310b
commit
ca693456ea
|
@ -307,7 +307,9 @@
|
|||
:nfs-granted? granted?
|
||||
:db-restoring? db-restoring?
|
||||
:system-theme? system-theme?
|
||||
:on-click editor-handler/unhighlight-blocks!}
|
||||
:on-click #(do
|
||||
(editor-handler/unhighlight-blocks!)
|
||||
(util/fix-open-external-with-shift! %))}
|
||||
|
||||
[:div.theme-inner
|
||||
(sidebar-mobile-sidebar
|
||||
|
|
|
@ -1374,6 +1374,14 @@
|
|||
(count val))]
|
||||
(.setRangeText input "" current (inc idx)))))
|
||||
|
||||
#?(:cljs
|
||||
(defn fix-open-external-with-shift!
|
||||
[^js/MouseEvent e]
|
||||
(when (and (.-shiftKey e) util/win32? (util/electron?)
|
||||
(= (string/lower-case (.. e -target -nodeName)) "a")
|
||||
(string/starts-with? (.. e -target -href) "file:"))
|
||||
(.preventDefault e))))
|
||||
|
||||
(defn classnames
|
||||
"Like react classnames utility:
|
||||
|
||||
|
|
Loading…
Reference in New Issue