Browse Source

enhance(mobile): tweak CodeMirror css

leizhe 4 years ago
parent
commit
c5adb7457f

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

@@ -185,15 +185,17 @@
         (left-menu-button {:on-click (fn []
                                        (open-fn)
                                        (state/set-left-sidebar-open!
-                                         (not (:ui/left-sidebar-open? @state/state))))})
+                                        (not (:ui/left-sidebar-open? @state/state))))})
 
         (when current-repo ;; this is for the Search button
           (ui/with-shortcut :go/search "right"
             [:a.button#search-button
-             {:on-click #(do (state/set-left-sidebar-open! false)
+             {:on-click #(do (when (or (mobile-util/native-android?)
+                                       (mobile-util/native-iphone?))
+                               (state/set-left-sidebar-open! false))
                              (state/pub-event! [:go/search]))}
              (ui/icon "search" {:style {:fontSize ui/icon-size}})]))]
-
+       
        [:div.r.flex
         (when (and (not (mobile-util/is-native-platform?))
                    (not (util/electron?)))

+ 9 - 2
src/main/frontend/extensions/code.css

@@ -7,11 +7,17 @@
   justify-content: space-between;
   &-lang {
     @apply p-1 text-sm;
-    margin-top: 3px;
     background: var(--ls-secondary-background-color);
     word-break: keep-all;
-    height:2rem;
+    position: absolute;
+    width: fit-content;
+    /* height:2rem; */
     order:3;
+    display: flex;
+    left: auto;
+    right: 0;
+    margin-top: 4px;
+    z-index: 9999;
   }
 
   &-calc {
@@ -42,6 +48,7 @@
     height: auto;
     margin-top: 4px;
     margin-bottom: 6px;
+    padding-top: 20px;
     font-family: Fira Code, Monaco, Menlo, Consolas, 'COURIER NEW', monospace;
     max-width: var(--ls-main-content-max-width-wide);
     border-radius: 2px;

+ 2 - 1
src/main/frontend/handler/mobile/swipe.cljs

@@ -21,6 +21,7 @@
                                         (:yStart detail)
                                         (if (mobile-util/native-android?)
                                           (<= (:yStart detail) 200)
-                                          true))
+                                          true)
+                                        (<= (:xStart detail) 20))
                                (state/set-left-sidebar-open! true))
                              nil))))))