

Code Spelunking in the all new Basecamp - aaronbrethorst
http://37signals.com/svn/posts/3167-code-spelunking-in-the-all-new-basecamp

======
radagaisus
$('[data-behavior~=date_picker]').live 'focus', -> $(this).datepicker()

So basically every focus on the element creates a new datepicker. If you're
not careful this could mean memory bloat and unpredictable behavior as the
plugin is attached several times.

~~~
sim0n
I'm guessing their datepicker() function checks if the datepicker has already
been attached or not.

By using onfocus rather than attaching it on page load, the datepicker isn't
loaded until it's required (gives a minor speed improvement I imagine).

------
rb2k_
I wonder why they use both, redis and memcached. Wouldn't redis be a decent
enough replacement so they could kick a bit of additional infrastructure

------
qrush
Thanks for the repost! Herp derp admin links :(

