(cc'ing clojurescr...@googlegroups.com) Hi James,
Let me make sure I understand what you're asking: you have a parent enclosing component that has to do calculations to position a set of child component element, but you can only properly calculate positioning for those child elements (in the parent?) after you get offset position information for each one, once they have mounted? DD On 2015/03/06 13:40, James Reeves wrote: > I've been writing an application using Om, and I've come across a > problem I haven't been able to find a good solution for. I'd be grateful > for any ideas people might have on how to proceed. > > In a nutshell, I have a bunch of elements that need to be arranged > according to a specific algorithm. They cannot overlap, so I need to > know the sizes of all the elements in order to arrange them. > > Om has an IDidMount protocol which is called after the component has > been mounted into the DOM. I can use this to find out the size of the > element: > > (let [node (get-node owner)] > [(.-offsetWidth node) (.-offsetHeight node)]) > > Elements can be hidden with "visibility: hidden" until their sizes are > known. > > The problem that's stumping me is how to deliver the sizes back to the > containing component so that all the elements can be arranged correctly. > > The most obvious way is via the cursor, but I don't like the idea of > mixing application state with local display information. Can anyone > think of a better way? > > - James > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clojure@googlegroups.com > Note that posts from new members are moderated - please be patient with > your first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en > --- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To unsubscribe from this group and stop receiving emails from it, send > an email to clojure+unsubscr...@googlegroups.com > <mailto:clojure+unsubscr...@googlegroups.com>. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.