浏览代码

enhance(mobile): add a undo button to toolbar

leizhe 3 年之前
父节点
当前提交
ae6eba7ed7
共有 1 个文件被更改,包括 10 次插入2 次删除
  1. 10 2
      src/main/frontend/components/editor.cljs

+ 10 - 2
src/main/frontend/components/editor.cljs

@@ -24,7 +24,8 @@
             [frontend.util.keycode :as keycode]
             [goog.dom :as gdom]
             [promesa.core :as p]
-            [rum.core :as rum]))
+            [rum.core :as rum]
+            [frontend.handler.history :as history]))
 
 (rum/defc commands < rum/reactive
   [id format]
@@ -228,7 +229,7 @@
                            (:offset-top vw-state))
                         0)}
       :class (util/classnames [{:is-vw-pending (boolean vw-pending?)}])}
-     [:div.flex.overflow-scroll
+     [:div.flex {:style {:overflow "overlay"}}
       [:div
        [:button.bottom-action
         {:on-mouse-down (fn [e]
@@ -275,6 +276,13 @@
                             (.focus input)))}
         (ui/icon "arrow-back"
                  {:style {:fontSize ui/icon-size}})]]
+      [:div
+       [:button.bottom-action
+        {:on-mouse-down (fn [e]
+                          (util/stop e)
+                          (history/undo! e))}
+        (ui/icon "rotate"
+                 {:style {:fontSize ui/icon-size}})]]
       [:div
        [:button.bottom-action
         {:on-mouse-down (fn [e]