Skip to content

Commit

Permalink
fix(sidebar): logseq#1281
Browse files Browse the repository at this point in the history
  • Loading branch information
xyhp915 authored and tiensonqin committed Feb 10, 2021
1 parent fb15b4b commit 4875e5b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/electron/electron/handler.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
(vec (cons {:path (fix-win-path! path)} result))))

;; TODO: Is it going to be slow if it's a huge directory
(defmethod handle :openDir [window _messages]
(defmethod handle :openDir [^js window _messages]
(let [result (.showOpenDialogSync dialog (bean/->js
{:properties ["openDirectory"]}))
path (first result)]
Expand Down
20 changes: 10 additions & 10 deletions src/main/frontend/util.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -399,20 +399,20 @@
:behavior "smooth"}))))))

#?(:cljs
(defn scroll-to
([pos]
(scroll-to pos true))
([pos animate?]
(scroll-to (app-scroll-container-node) pos animate?))
([node pos animate?]
(.scroll node
#js {:top pos
:behavior (if animate? "smooth" "auto")}))))
(defn scroll-to
([pos]
(scroll-to (app-scroll-container-node) pos))
([node pos]
(scroll-to node pos true))
([node pos animate?]
(.scroll node
#js {:top pos
:behavior (if animate? "smooth" "auto")}))))

#?(:cljs
(defn scroll-to-top
[]
(scroll-to 0 false)))
(scroll-to (app-scroll-container-node) 0 false)))

(defn url-encode
[string]
Expand Down

0 comments on commit 4875e5b

Please sign in to comment.