This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-11-17
Channels
- # bangalore-clj (4)
- # beginners (60)
- # boot (63)
- # cider (2)
- # cljs-dev (22)
- # cljsrn (3)
- # clojars (32)
- # clojure (133)
- # clojure-gamedev (1)
- # clojure-germany (17)
- # clojure-italy (1)
- # clojure-russia (11)
- # clojure-serbia (16)
- # clojure-spec (35)
- # clojure-uk (75)
- # clojurebridge (1)
- # clojurescript (83)
- # community-development (25)
- # core-async (43)
- # cursive (15)
- # datomic (28)
- # emacs (2)
- # fulcro (108)
- # graphql (5)
- # hoplon (15)
- # lein-figwheel (6)
- # leiningen (39)
- # lumo (106)
- # new-channels (1)
- # off-topic (4)
- # om (26)
- # om-next (53)
- # onyx (46)
- # other-languages (2)
- # perun (1)
- # protorepl (5)
- # re-frame (13)
- # ring (18)
- # ring-swagger (1)
- # rum (6)
- # shadow-cljs (82)
- # spacemacs (19)
- # specter (5)
- # sql (3)
- # test-check (31)
- # unrepl (12)
- # untangled (2)
- # vim (109)
Happy Friday, all. I had a look at the "special cases" doc, but wasn't enlightened. I have a formula cell foo
which just evaluates to a String, which I'm using like this:
(cond-tpl
foo (td :class foo (span foo))
:else
(etc))
But the class attribute ends up being multi-valued (i.e. some other things in the outer-level collection being looped)Changing it to :class (cell= {foo true})
loops fewer of the outer-loop stuff, although it is accurate on the class attribute
ah yes, this is a thing that pops up from time to time
the problem is that :class doesn't remove previously added classes, only adds them
hm, actually, it appears to toggle: https://github.com/hoplon/hoplon/blob/master/src/hoplon/jquery.cljs#L79-L83
but you can experiment with it by making your own attribute and doing the jquery you want inside it
opyate are you familiar w/ mulimethods or do!/on! in particular?
cool. there's not a whole lot to know, but when you know it you know like 50% of hoplon underbelly
basically do! is a multimethod for implementing ways for cells to influence elements, and on! is the way to attach events from elements to cljs functions (:click, :hover etc)
adding your own is a dimension on which you can specialize your app to a particular target platform (mobile) or to build your own layout language atop html
@opyate I’m not sure exactly what your issue is with the hash-map version of :class
, also which version are you using?