Fork me on GitHub
#hoplon
<
2016-11-24
>
laforge4918:11:17

Something is seriously wrong. I'm trying to use prop-cell on the display property of an element.

laforge4918:11:35

(j/defc= consoleheader-element nil) (add-watch login/all-logged-in :re (fn [ ] (let [e (.getElementById js/document "consoleheader")] (j/prop-cell (.-display (.-style e)) consoleheader-element #(.log js/console "tweet")) (.log js/console (pr-str "ho " (.-display (.-style e)))) ) ))

laforge4918:11:36

I get this output:

laforge4918:11:59

followed by an infinite stream of "tweet".

laforge4918:11:06

@micha? @flyboarder? @alandipert? I think I'm dead in the water at this point. 😞

laforge4918:11:19

Hope everyone is enjoying a nice turkey or vegan equivalent today. 🙂

flyboarder18:11:51

No I'm in Canada we did that in October

flyboarder18:11:25

Do you have a link to the file?

laforge4918:11:13

oK, sync complete. See line 56

flyboarder18:11:55

Ok so prop-cell is going to poll the element for the property value

flyboarder18:11:02

@laforge49: is all-logged-in a cell? You can just build a formula cell that merges that and the value from prop-cell when it's valid

laforge4918:11:08

all-logged-in is a cell in some lower-level code that doesn't know mutch about the applications like console.

laforge4918:11:31

It is set to true after a do-sync.

flyboarder18:11:13

Ok so you can create a variable from prop-cell and then check the value in a formula when the logged-in cell is true

flyboarder18:11:18

If that makes sense

laforge4918:11:09

Before login, the element does not exist.

laforge4918:11:35

I can try creating a cell using the other form of prop-cell and add a watch to it to create that callback.

laforge4919:11:28

But right now I need a break. Sleepy after lunch. 😞 @flyboarder

laforge4921:11:38

Thanks @flyboarder --got it working.

laforge4921:11:35

And I think I can greatly simplify my design by just polling on the height of the object returned by calling getBoundingClientRect of the actual header rather than waiting for the appropriate sub-heading element to be visible. Polling (shudder) is very powerful. At lest, when not used in a server!

flyboarder21:11:08

Yeah just be careful not to endlessly print to the console :P