enhance(mobile): add a undo button to toolbar

pull/3374/head
leizhe 2021-12-15 08:13:24 +08:00
parent d5ad9dc371
commit ae6eba7ed7
1 changed files with 10 additions and 2 deletions

View File

@ -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]