From de5036bc9bb8e7cd55de85b645df2e38422c8306 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Tue, 26 Jan 2016 22:27:25 +0200 Subject: [PATCH] Minor code reorg on workspace base ns. --- src/uxbox/schema.cljs | 1 - src/uxbox/ui/workspace/base.cljs | 22 +++++++++++++--------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/uxbox/schema.cljs b/src/uxbox/schema.cljs index 7329d09cb1..eec520f477 100644 --- a/src/uxbox/schema.cljs +++ b/src/uxbox/schema.cljs @@ -41,7 +41,6 @@ [v] (vector? v)) - (v/defvalidator function "Validats if `v` is function." {:default-message-format "%s must be a function."} diff --git a/src/uxbox/ui/workspace/base.cljs b/src/uxbox/ui/workspace/base.cljs index 67e9f204db..da9c90a013 100644 --- a/src/uxbox/ui/workspace/base.cljs +++ b/src/uxbox/ui/workspace/base.cljs @@ -100,6 +100,19 @@ (rx/buffer 2 1) (rx/map coords-delta))) +;; Materialized views + +(defonce mouse-position + (->> mouse-s + (rx/sample 50) + (rx/to-atom))) + +(defonce bounding-rect (atom {})) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Subscriptions +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + (define-once :mouse-subscriptions (as-> mouse-delta-s $ (rx/filter #(deref shapes-dragging?) $) @@ -155,15 +168,6 @@ pos [x (+ y scroll)]] (swap! selrect-pos assoc :current pos))))))) -;; Materialized views - -(defonce mouse-position - (->> mouse-s - (rx/sample 50) - (rx/to-atom))) - -(defonce bounding-rect (atom {})) - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Constants ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;