3 ms·
Code Spelunking in the all new Basecamp
- qrush 15y agoThanks for the repost! Herp derp admin links :(
- rb2k_ 15y agoI 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
- radagaisus 15y ago$('[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 15y agoI'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).