Small javascript fix.

Accidentally forgot to move the sorting javsacript to the profile
template.