0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-23 23:18:48 -05:00
penpot/frontend/uxbox/data/workspace.cljs
2015-12-30 00:19:47 +02:00

33 lines
940 B
Clojure

(ns uxbox.data.workspace
(:require [uxbox.rstore :as rs]
[uxbox.router :as r]
[uxbox.state :as st]
[uxbox.schema :as sc]
[uxbox.time :as time]
[bouncer.validators :as v]))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Events
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defn toggle-pagesbar
[]
(reify
rs/UpdateEvent
(-apply-update [_ state]
(update-in state [:workspace :pagesbar-enabled] (fnil not false)))
IPrintWithWriter
(-pr-writer [mv writer _]
(-write writer "#<event:u.s.p/toggle-pagebar>"))))
(defn toggle-grid
[]
(reify
rs/UpdateEvent
(-apply-update [_ state]
(update-in state [:workspace :grid-enabled] (fnil not false)))
IPrintWithWriter
(-pr-writer [mv writer _]
(-write writer "#<event:u.s.p/toggle-grid>"))))