Can someone explain this? The code shown will print negative y values when sliding my scroller upward (expected). But if I say "print @scrollY", it always prints 0 (unexpected). scroller is just a standard ScrollComponent.
Woops perfect storm.
- The @ here is the content layer- @content.y is always the same as [email protected]- The @scrollY in this case is the "old style overflow: scroll" scrollY that is still on every layer for compat reasons.
You will get what you expect if you do "print @superLayer.scrollY"
Maybe a solution is to scope Events.Move to the ScrollComponent instead of the ScrollComponent.content, but that is not consistent with everywhere else. I'll have to think about this a bit more.
I see I tripped on a tough one. Glad I'm not serving up the easy ones. :)
There is some beauty in this complexity. Hmmm programming.
Excellent reading, JL! I'm going to be spending some time with this series.
Coffeescript bends these rules slightly however. Thanks for sharing that book!
Koen Bok - in this instance might it make sense to just map the scrollY to the superLayer value?
That kinda makes sense since you'd never really use scrollY on the content in a scrollComponent scenario.
Thanks for sharing JL Flores Mena - that looks like a great read. :-)