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
will do, thanks for the reply
opyate are you familiar w/ mulimethods or do!/on! in particular?
multimethods, yes - haven't looked at implementations of do!/on!
your link is my first time looking at the code
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
ok, I'll try and figure out why toggleClass has baggage for a brand new element
@opyate I’m not sure exactly what your issue is with the hash-map version of :class
, also which version are you using?