Fix for ajax

Change main "click" event to "on click". After an ajax load, the refresh method will reset the elements list, and you will be able to click on new elements.
For example, after an infinite scroll event.

Additionally some clean up and comment added. jsHint validate