Преглед на файлове

enhance(mobile): disable tooltip on mobile

Tienson Qin преди 4 години
родител
ревизия
d5f6eb5e66
променени са 2 файла, в които са добавени 12 реда и са изтрити 9 реда
  1. 7 6
      src/main/frontend/components/header.cljs
  2. 5 3
      src/main/frontend/state.cljs

+ 7 - 6
src/main/frontend/components/header.cljs

@@ -187,10 +187,10 @@
                    (remove #(= (:url %) config/local-repo)))
         electron-mac? (and util/mac? (util/electron?))
         electron-not-mac? (and (util/electron?) (not electron-mac?))
-        show-open-folder? (or
-                           (and (nfs/supported?) (empty? repos)
-                                (not config/publishing?))
-                           (mobile-util/is-native-platform?))
+        show-open-folder? (and (or (nfs/supported?)
+                                   (mobile-util/is-native-platform?))
+                               (empty? repos)
+                               (not config/publishing?))
         refreshing? (state/sub :nfs/refreshing?)]
     (rum/with-context [[t] i18n/*tongue-context*]
       [:div.cp__header#head
@@ -247,8 +247,9 @@
 
        (repo/sync-status current-repo)
 
-       [:div.repos
-        (repo/repos-dropdown nil)]
+       (when-not (util/mobile?)
+         [:div.repos
+          (repo/repos-dropdown nil)])
 
        (when show-open-folder?
          [:a.text-sm.font-medium.button

+ 5 - 3
src/main/frontend/state.cljs

@@ -1149,9 +1149,11 @@
 
 (defn enable-tooltip?
   []
-  (get (get (sub-config) (get-current-repo))
-       :ui/enable-tooltip?
-       true))
+  (if (util/mobile?)
+    false
+    (get (get (sub-config) (get-current-repo))
+        :ui/enable-tooltip?
+        true)))
 
 (defn show-command-doc?
   []