Fixes #277 Error on homepage.
Fixes #277 Error on homepage.

Since the $('#js-matrix-legend-affix') element doesn't exist on the home page, $('#js-matrix-legend-affix').offset() is undefined.  This makes sure the element exists on the page before trying to use it.
donejs/donejs,donejs/donejs