From d95b43f9c17a82723a992f275111edc98c3d5ee7 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Fri, 3 Mar 2017 13:14:50 +0100 Subject: [PATCH] Fix undo redo buttons on workspace. And add minor improvements to the undo/redo changes detection system. --- frontend/src/uxbox/main/data/shapes.cljs | 1 + frontend/src/uxbox/main/data/undo.cljs | 2 +- frontend/src/uxbox/main/ui/workspace/header.cljs | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/frontend/src/uxbox/main/data/shapes.cljs b/frontend/src/uxbox/main/data/shapes.cljs index e8cd0546d3..a1f2fed362 100644 --- a/frontend/src/uxbox/main/data/shapes.cljs +++ b/frontend/src/uxbox/main/data/shapes.cljs @@ -218,6 +218,7 @@ ;; --- Apply Displacement (deftype ApplyDisplacement [id] + udp/IPageUpdate ptk/WatchEvent (watch [_ state stream] (let [displacement (get-in state [:workspace :modifiers id :displacement])] diff --git a/frontend/src/uxbox/main/data/undo.cljs b/frontend/src/uxbox/main/data/undo.cljs index 0568b660f3..ccf7daca77 100644 --- a/frontend/src/uxbox/main/data/undo.cljs +++ b/frontend/src/uxbox/main/data/undo.cljs @@ -31,7 +31,6 @@ (satisfies? udp/IMetadataUpdate %))) (rx/filter #(not (undo? %))) (rx/filter #(not (redo? %))) - (rx/debounce 500) (rx/map #(save-undo-entry id)))))) (defn watch-page-changes @@ -53,6 +52,7 @@ (defn save-undo-entry [id] + {:pre [(uuid? id)]} (SaveUndoEntry. id)) (defn save-undo-entry? diff --git a/frontend/src/uxbox/main/ui/workspace/header.cljs b/frontend/src/uxbox/main/ui/workspace/header.cljs index 0805058e08..442b924b5c 100644 --- a/frontend/src/uxbox/main/ui/workspace/header.cljs +++ b/frontend/src/uxbox/main/ui/workspace/header.cljs @@ -55,8 +55,8 @@ page (mx/react refs/selected-page) flags (mx/react refs/flags) toggle #(st/emit! (dw/toggle-flag %)) - on-undo #(st/emit! (udh/backwards-to-previous-version)) - on-redo #(st/emit! (udh/forward-to-next-version)) + on-undo #(st/emit! (udu/undo)) + on-redo #(st/emit! (udu/redo)) on-image #(udl/open! :import-image) on-download #(udl/open! :download)] [:header#workspace-bar.workspace-bar