Browse Source

fix: don't show mod+enter to inline #Page

Tienson Qin 4 tháng trước cách đây
mục cha
commit
8f1d01daad

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

@@ -254,7 +254,9 @@
                                                                     "Search for a node")]
          :class "black"})
 
-       (when (and db-based? db-tag? (not (string/blank? q)))
+       (when (and db-based? db-tag?
+                  (not (string/blank? q))
+                  (not= "page" (string/lower-case q)))
          [:p.px-1.opacity-50.text-sm
           [:code (if util/mac? "Cmd+Enter" "Ctrl+Enter")]
           [:span " to display this tag inline instead of at the end of this node."]])])))

+ 2 - 1
src/main/frontend/handler/page.cljs

@@ -226,7 +226,8 @@
             class? (and db-based?
                         (or (string/includes? chosen (str (t :new-tag) " "))
                             (ldb/class? chosen-result)))
-            inline-tag? (and class? (= (.-identifier e) "auto-complete/meta-complete"))
+            inline-tag? (and class? (= (.-identifier e) "auto-complete/meta-complete")
+                             (not= chosen "Page"))
             chosen (-> chosen
                        (string/replace-first (str (t :new-tag) " ") "")
                        (string/replace-first (str (t :new-page) " ") ""))