fix jQuery 1.9 compatibility issue

As per this discussion:
https://github.com/gregbell/active_admin/pull/1879#discussion_r3453478
cleanup

this is a general refactor, and doesn't change behaviour
Merge pull request #2016 from Daxter/refactor/js

JS Refactor