mirror of
https://github.com/logseq/logseq.git
synced 2026-06-01 19:01:22 +00:00
Merge branch 'feat/db' into refactor/narrow-gap-between-page-and-block
This commit is contained in:
@@ -3244,10 +3244,17 @@
|
||||
(some-> (first (dom/by-class "reveal"))
|
||||
(dom/has-class? "focused")))
|
||||
|
||||
(defn- in-page-preview?
|
||||
[]
|
||||
(some-> js/document.activeElement
|
||||
(.closest ".ls-preview-popup")
|
||||
(nil?) (not)))
|
||||
|
||||
(defn shortcut-up-down [direction]
|
||||
(fn [e]
|
||||
(when (and (not (auto-complete?))
|
||||
(not (in-shui-popup?))
|
||||
(or (in-page-preview?)
|
||||
(not (in-shui-popup?)))
|
||||
(not (slide-focused?))
|
||||
(not (state/get-timestamp-block)))
|
||||
(util/stop e)
|
||||
@@ -3287,17 +3294,14 @@
|
||||
(defn open-selected-block!
|
||||
[direction e]
|
||||
(let [selected-blocks (state/get-selection-blocks)
|
||||
f (case direction
|
||||
:left first
|
||||
:right last)]
|
||||
(when-let [block-id (some-> selected-blocks
|
||||
f
|
||||
(dom/attr "blockid")
|
||||
uuid)]
|
||||
f (case direction :left first :right last)
|
||||
node (some-> selected-blocks f)]
|
||||
(when-let [block-id (some-> node (dom/attr "blockid") uuid)]
|
||||
(util/stop e)
|
||||
(let [block {:block/uuid block-id}
|
||||
left? (= direction :left)]
|
||||
(edit-block! block (if left? 0 :max))))))
|
||||
(let [block {:block/uuid block-id}
|
||||
left? (= direction :left)
|
||||
opts {:container-id (some-> node (dom/attr "containerid") (parse-long))}]
|
||||
(edit-block! block (if left? 0 :max) opts)))))
|
||||
|
||||
(defn shortcut-left-right [direction]
|
||||
(fn [e]
|
||||
|
||||
Reference in New Issue
Block a user