mirror of https://github.com/logseq/logseq
fix: selection
parent
58980188a8
commit
ee95b5070b
|
@ -175,7 +175,7 @@
|
|||
(ui/resize-provider
|
||||
(ui/resize-consumer
|
||||
(cond->
|
||||
{:className "resize"
|
||||
{:className "resize image-resize"
|
||||
:onSizeChanged (fn [value]
|
||||
(when (and (not @*resizing-image?)
|
||||
(some? @size)
|
||||
|
@ -1338,12 +1338,16 @@
|
|||
|
||||
(defn- block-content-on-mouse-down
|
||||
[e block block-id properties content format edit-input-id]
|
||||
(let [target (gobj/get e "target")]
|
||||
(.stopPropagation e)
|
||||
(let [target (gobj/get e "target")
|
||||
button (gobj/get e "buttons")]
|
||||
(when (= button 1)
|
||||
(when-not (or (util/link? target)
|
||||
(util/input? target)
|
||||
(util/details-or-summary? target)
|
||||
(and (util/sup? target)
|
||||
(d/has-class? target "fn")))
|
||||
(d/has-class? target "fn"))
|
||||
(d/has-class? target "image-resize"))
|
||||
(editor-handler/clear-selection! nil)
|
||||
(editor-handler/unhighlight-block!)
|
||||
(let [properties-hidden? (text/properties-hidden? properties)
|
||||
|
@ -1358,7 +1362,10 @@
|
|||
content
|
||||
block
|
||||
cursor-range))
|
||||
5)))))
|
||||
5))
|
||||
|
||||
(when-not (state/get-selection-start-block)
|
||||
(when block-id (state/set-selection-start-block! block-id)))))))
|
||||
|
||||
(defn- block-content-on-drag-over
|
||||
[event uuid]
|
||||
|
@ -1572,19 +1579,6 @@
|
|||
(reset! *dragging-block nil)
|
||||
(editor-handler/unhighlight-block!))
|
||||
|
||||
;; (defn- block-mouse-move
|
||||
;; [e]
|
||||
;; (when (and (non-dragging? e)
|
||||
;; (not @*resizing-image?))
|
||||
;; (state/into-selection-mode!)))
|
||||
|
||||
(defn- block-mouse-down
|
||||
[e block-id]
|
||||
(when (and
|
||||
(not (state/get-selection-start-block))
|
||||
(= (gobj/get e "buttons") 1))
|
||||
(when block-id (state/set-selection-start-block! block-id))))
|
||||
|
||||
(defn- block-mouse-over
|
||||
[e has-child? *control-show? block-id doc-mode?]
|
||||
(util/stop e)
|
||||
|
@ -1621,9 +1615,6 @@
|
|||
(block-drag-leave event uuid *move-to-top?))
|
||||
:on-drop (fn [event]
|
||||
(block-drop event uuid block *move-to-top?))
|
||||
;; :on-mouse-move block-mouse-move
|
||||
:on-mouse-down (fn [e]
|
||||
(block-mouse-down e block-id))
|
||||
:on-mouse-over (fn [e]
|
||||
(block-mouse-over e has-child? *control-show? block-id doc-mode?))
|
||||
:on-mouse-leave (fn [e]
|
||||
|
|
|
@ -276,8 +276,10 @@
|
|||
;; hide context menu
|
||||
(state/hide-custom-context-menu!)
|
||||
|
||||
(if-not (state/get-selection-start-block)
|
||||
(editor-handler/clear-selection! e)
|
||||
(editor-handler/clear-selection! e)))
|
||||
(mixins/listen state js/window "mouseup"
|
||||
(fn [e]
|
||||
(when (state/get-selection-start-block)
|
||||
(state/set-selection-start-block! nil))))
|
||||
|
||||
;; TODO: move to keyboards
|
||||
|
|
|
@ -169,6 +169,7 @@
|
|||
state)}
|
||||
[state config id attr code pos_meta]
|
||||
[:div.extensions__code
|
||||
{:on-mouse-down (fn [e] (util/stop e))}
|
||||
[:div.extensions__code-lang
|
||||
(let [mode (string/lower-case (get attr :data-lang "javascript"))]
|
||||
(if (= mode "text/x-clojure")
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
(ns frontend.version)
|
||||
|
||||
(defonce version "0.0.15-8")
|
||||
(defonce version "0.0.15-9")
|
||||
|
|
Loading…
Reference in New Issue