I am relatively new to Framer and CoffeeScript – so please bear with me as I take the degree of difficulty down about 40 notches for most of you.
As a learning exercise I set about the task of creating a simple switch component. It's far from perfect in some of the finer details, but has two major problems now which I don't know how to solve.
One is that my switchBg state is not being applied if onTouchEnd (AKA mousing up) is ended outside the bounds of switchBg. Am I doing this totally wrong? Should I just be binding the state of switchBg to the state of switchHandle?
and possibly related...
Curious as to why does my .onTouchEnd needs to be wrapped in a click event on switchBg? I did this to prevent the switchHandle from twitching and fidgeting while be dragged – but I don't exactly understand *why* I had to do this.
Any input or comments on any of the above would be greatly appreciated. Also feel free to point out obvious optimizations that could be made – engineering wise this is probably far from desirable, but with some help I think I can improve on it and learn more doing so.