|
|
@@ -1727,36 +1727,6 @@
|
|
|
(.focus input)
|
|
|
(cursor/move-cursor-to input saved-cursor))))
|
|
|
|
|
|
-(defn open-block!
|
|
|
- [first?]
|
|
|
- (fn [e]
|
|
|
- (let [edit-id (state/get-last-edit-input-id)
|
|
|
- block-id (when edit-id (subs edit-id (- (count edit-id) 36)))
|
|
|
- last-edit-block (first (array-seq (js/document.getElementsByClassName block-id)))
|
|
|
- nodes (array-seq (js/document.getElementsByClassName "ls-block"))
|
|
|
- first-node (first nodes)
|
|
|
- node (cond
|
|
|
- last-edit-block
|
|
|
- last-edit-block
|
|
|
- first?
|
|
|
- first-node
|
|
|
- :else
|
|
|
- (when-let [blocks-container (util/rec-get-blocks-container first-node)]
|
|
|
- (let [nodes (dom/by-class blocks-container "ls-block")]
|
|
|
- (last nodes))))]
|
|
|
- (when node
|
|
|
- (state/clear-selection!)
|
|
|
- (unhighlight-blocks!)
|
|
|
- (let [block-id (and node (dom/attr node "blockid"))
|
|
|
- edit-block-id (string/replace (gobj/get node "id") "ls-block" "edit-block")
|
|
|
- block-id (medley/uuid block-id)]
|
|
|
- (when-let [block (or (db/entity [:block/uuid block-id])
|
|
|
- {:block/uuid block-id})]
|
|
|
- (edit-block! block
|
|
|
- :max
|
|
|
- (:block/format block)
|
|
|
- edit-block-id)))))))
|
|
|
-
|
|
|
(defn get-search-q
|
|
|
[]
|
|
|
(when-let [id (state/get-edit-input-id)]
|