Просмотр исходного кода

feat(gesture): tweak action bar

llcc 3 лет назад
Родитель
Сommit
a8c75cf679

+ 1 - 1
src/main/frontend/components/block.cljs

@@ -2086,7 +2086,7 @@
   [:div.block-left-menu.flex.bg-base-2.rounded-r-md.mr-1
    [:div.commands-button.w-0.rounded-r-md
     {:id (str "block-left-menu-" uuid)}
-    [:indent (ui/icon "indent-increase" {:style {:fontSize 16}})]]])
+    [:div.indent (ui/icon "indent-increase" {:style {:fontSize 16}})]]])
 
 (rum/defc block-right-menu < rum/reactive
   [_config {:block/keys [uuid] :as _block}]

+ 6 - 3
src/main/frontend/components/sidebar.cljs

@@ -281,7 +281,7 @@
                               (let [format (:block/format (state/get-edit-block))]
                                 (editor-handler/upload-asset id files format editor-handler/*asset-uploading? true))))}))
                 state)}
-  [{:keys [route-match global-graph-pages? route-name indexeddb-support? db-restoring? main-content]}]
+  [{:keys [route-match global-graph-pages? route-name indexeddb-support? db-restoring? main-content show-action-bar?]}]
   (let [left-sidebar-open? (state/sub :ui/left-sidebar-open?)
         onboarding-and-home? (and (or (nil? (state/get-current-repo)) (config/demo-graph?))
                                   (not config/publishing?)
@@ -295,15 +295,18 @@
 
      [:div#main-content-container.scrollbar-spacing.w-full.flex.justify-center.flex-row
 
+      (when show-action-bar?
+        (action-sheet/action-bar))
+      
       [:div.cp__sidebar-main-content
        {:data-is-global-graph-pages global-graph-pages?
         :data-is-full-width         (or global-graph-pages?
                                         (contains? #{:all-files :all-pages :my-publishing} route-name))}
-
+       
        (when (and (not (mobile-util/is-native-platform?))
                   (contains? #{:page :home} route-name))
          (widgets/demo-graph-alert))
-
+       
        (cond
          (not indexeddb-support?)
          nil

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

@@ -962,9 +962,7 @@
 
 (defn select-block!
   [block-uuid]
-  (let [blocks (js/document.getElementsByClassName (str block-uuid))]
-    (when (seq blocks)
-      (state/exit-editing-and-set-selected-blocks! blocks))))
+  (block-handler/select-block! block-uuid))
 
 (defn- compose-copied-blocks-contents
   [repo block-ids]

+ 17 - 3
src/main/frontend/mobile/index.css

@@ -23,16 +23,15 @@
 }
 
 .action-bar {
-    position: fixed;
+    position: absolute;
     bottom: 100px;
-    left: 5%;
     height: 70px;
-    width: 90%;
     background-color: var(--ls-secondary-background-color);
     display: flex;
     justify-content: space-around;
     border-radius: 10px;
     box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.05);
+    z-index: 100;
     
     .ti {
         color: var(--ls-primary-text-color);
@@ -60,9 +59,19 @@ html.is-native-ipad {
         flex: 1;
         index: 0;
     }
+    
+    .action-bar {
+        width: 50%;
+    }
 }
 
 html.is-native-iphone {
+
+    .action-bar {
+        left: 5%;
+        right: 5%;
+    }
+    
     @media (orientation: landscape) {
         .cp__footer {
             height: 45px;
@@ -75,5 +84,10 @@ html.is-native-android {
     .cp__footer {
         height: 45px;
     }
+    
+    .action-bar {
+        left: 5%;
+        right: 5%;
+    }
 }