Browse Source

fix(mobile): modal pop window position

leizhe 4 years ago
parent
commit
61f7653e79
2 changed files with 5 additions and 9 deletions
  1. 3 5
      src/main/frontend/components/editor.cljs
  2. 2 4
      src/main/frontend/handler/editor.cljs

+ 3 - 5
src/main/frontend/components/editor.cljs

@@ -271,8 +271,7 @@
        {:on-mouse-down (fn [e]
                          (util/stop e)
                          (viewport-fn)
-                         (commands/simple-insert! parent-id "\n"
-                                                  {:forward-pos 1}))}
+                         (commands/simple-insert! parent-id "\n" {}))}
        (ui/icon "arrow-back"
                 {:style {:fontSize ui/icon-size}})]]
      [:div
@@ -313,9 +312,8 @@
                          (viewport-fn)
                          (commands/simple-insert!
                           parent-id "#"
-                          {:check-fn     (fn [_ _ new-pos]
-                                           (commands/handle-step [:editor/search-page-hashtag])
-                                           (reset! commands/*slash-caret-pos new-pos))}))}
+                          {:check-fn  (fn []
+                                        (commands/handle-step [:editor/search-page-hashtag]))}))}
        (ui/icon "tag"
                 {:style {:fontSize ui/icon-size}})]]
      [:div

+ 2 - 4
src/main/frontend/handler/editor.cljs

@@ -2524,8 +2524,7 @@
                           (commands/simple-insert!
                            parent-id bounds
                            {:backward-pos backward-pos
-                            :check-fn     (fn [_ _ new-pos]
-                                            (reset! commands/*slash-caret-pos new-pos)
+                            :check-fn     (fn []
                                             (commands/handle-step [:editor/search-page]))}))]
         (state/set-editor-show-page-search! false)
         (let [selection (get-selection-and-format)
@@ -2556,8 +2555,7 @@
                            (commands/simple-insert!
                             parent-id bounds
                             {:backward-pos backward-pos
-                             :check-fn     (fn [_ _ new-pos]
-                                             (reset! commands/*slash-caret-pos new-pos)
+                             :check-fn     (fn []
                                              (commands/handle-step [:editor/search-block]))}))]
         (state/set-editor-show-block-search! false)
         (if-let [embed-ref (thingatpt/embed-macro-at-point input)]