The :hoplon: ClojureScript Web Framework - http://hoplon.io/
opyate 2017-11-17T16:26:22.000180Z

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:

  foo (td :class foo (span foo))
But the class attribute ends up being multi-valued (i.e. some other things in the outer-level collection being looped)

opyate 2017-11-17T16:29:53.000096Z

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 2017-11-17T16:34:19.000781Z

will do, thanks for the reply


opyate are you familiar w/ mulimethods or do!/on! in particular?

opyate 2017-11-17T16:36:33.000754Z

multimethods, yes - haven't looked at implementations of do!/on!

opyate 2017-11-17T16:37:26.000115Z

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

opyate 2017-11-17T16:47:59.000194Z

ok, I'll try and figure out why toggleClass has baggage for a brand new element

flyboarder 2017-11-17T18:22:42.000359Z

@opyate I’m not sure exactly what your issue is with the hash-map version of :class, also which version are you using?