Explorar el Código

feat(gesture): add `open in right sidebar` to iPad action bar

llcc hace 3 años
padre
commit
c20a98f9c4
Se han modificado 2 ficheros con 12 adiciones y 4 borrados
  1. 10 2
      src/main/frontend/mobile/action_bar.cljs
  2. 2 2
      src/main/frontend/mobile/index.css

+ 10 - 2
src/main/frontend/mobile/action_bar.cljs

@@ -10,7 +10,8 @@
    [frontend.util.url :as url-util]
    [goog.dom :as gdom]
    [goog.object :as gobj]
-   [rum.core :as rum]))
+   [rum.core :as rum]
+   [frontend.mobile.util :as mobile-util]))
 
 (defn- action-command
   [icon description command-handler]
@@ -67,4 +68,11 @@
                         (fn [_event] (let [current-repo (state/get-current-repo)
                                            tap-f (fn [block-id]
                                                    (url-util/get-logseq-graph-uuid-url nil current-repo block-id))]
-                                       (editor-handler/copy-block-ref! uuid tap-f))))]])))
+                                       (editor-handler/copy-block-ref! uuid tap-f))))
+        (when (mobile-util/native-ipad?)
+          (action-command "text-direction-ltr" "Right sidebar"
+                          (fn [_event]
+                            (let [current-repo (state/get-current-repo)]
+                              (state/sidebar-add-block! current-repo uuid :block-ref)))))]])))
+
+

+ 2 - 2
src/main/frontend/mobile/index.css

@@ -120,8 +120,8 @@ html.is-native-ipad {
     
     .action-bar {
         width: 70%;
-        min-width:450px;
-
+        min-width:550px;
+        
         .action-bar-commands {
             width: 100%;
         }