|
|
@@ -204,7 +204,6 @@
|
|
|
|
|
|
(defn clear-selection!
|
|
|
[]
|
|
|
- (util/select-unhighlight! (dom/by-class "selected"))
|
|
|
(state/clear-selection!))
|
|
|
|
|
|
(defn- text-range-by-lst-fst-line [content [direction pos]]
|
|
|
@@ -1222,8 +1221,7 @@
|
|
|
|
|
|
(defn clear-last-selected-block!
|
|
|
[]
|
|
|
- (let [block (state/drop-last-selection-block!)]
|
|
|
- (util/select-unhighlight! [block])))
|
|
|
+ (state/drop-last-selection-block!))
|
|
|
|
|
|
(defn highlight-selection-area!
|
|
|
[end-block]
|
|
|
@@ -1238,18 +1236,18 @@
|
|
|
(defn- select-block-up-down
|
|
|
[direction]
|
|
|
(cond
|
|
|
- ;; when editing, quit editing and select current block
|
|
|
+ ;; when editing, quit editing and select current block
|
|
|
(state/editing?)
|
|
|
(state/exit-editing-and-set-selected-blocks! [(gdom/getElement (state/get-editing-block-dom-id))])
|
|
|
|
|
|
- ;; when selection and one block selected, select next block
|
|
|
+ ;; when selection and one block selected, select next block
|
|
|
(and (state/selection?) (== 1 (count (state/get-selection-blocks))))
|
|
|
(let [f (if (= :up direction) util/get-prev-block-non-collapsed util/get-next-block-non-collapsed-skip)
|
|
|
element (f (first (state/get-selection-blocks)))]
|
|
|
(when element
|
|
|
(state/conj-selection-block! element direction)))
|
|
|
|
|
|
- ;; if same direction, keep conj on same direction
|
|
|
+ ;; if same direction, keep conj on same direction
|
|
|
(and (state/selection?) (= direction (state/get-selection-direction)))
|
|
|
(let [f (if (= :up direction) util/get-prev-block-non-collapsed util/get-next-block-non-collapsed-skip)
|
|
|
first-last (if (= :up direction) first last)
|
|
|
@@ -1257,7 +1255,7 @@
|
|
|
(when element
|
|
|
(state/conj-selection-block! element direction)))
|
|
|
|
|
|
- ;; if different direction, keep clear until one left
|
|
|
+ ;; if different direction, keep clear until one left
|
|
|
(state/selection?)
|
|
|
(clear-last-selected-block!))
|
|
|
nil)
|