Updated javascript to use .on()

* Used .on to ensure proper form submission after a post has been
edited inline
* updated use of .delegate to .on