Skip to content

Commit

Permalink
fix: remove resizing class on tab
Browse files Browse the repository at this point in the history
  • Loading branch information
sprocketc authored and tiensonqin committed Sep 14, 2022
1 parent d45d8c1 commit b150e1a
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/main/frontend/components/right_sidebar.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -206,15 +206,14 @@
(.on "keydown" (fn [e]
(when-let [sidebar-el (js/document.getElementById sidebar-id)]
(let [width js/document.documentElement.clientWidth
offset (+
(.-x (.getBoundingClientRect sidebar-el))
(case (.-code e)
"ArrowLeft" (- keyboard-step)
"ArrowRight" keyboard-step
0))
keyboard-step (case (.-code e)
"ArrowLeft" (- keyboard-step)
"ArrowRight" keyboard-step
0)
offset (+ (.-x (.getBoundingClientRect sidebar-el)) keyboard-step)
ratio (.toFixed (/ offset width) 6)
ratio (if (= handler-position :west) (- 1 ratio) ratio)]
(when (and (> ratio min-ratio) (< ratio max-ratio))
(when (and (> ratio min-ratio) (< ratio max-ratio) (not (zero? keyboard-step)))
((add-resizing-class)
(set-width! ratio sidebar-el)))))))
(.on "keyup" remove-resizing-class)))
Expand Down

0 comments on commit b150e1a

Please sign in to comment.