Forked the js and updated as per drupal javascript handling https://drupal.org/node/2229913