Added the const ID inside the "allow social" click handler.
Restored the $(document).ready(...) test inside onEvents() and (window).addEventListener() at the end even though these last changes might not be necessary.