I feel like we should make this a jQuery plugin, place within `components.js`