if (window.location.hash === '#products') { console.log('hello'); window.location = `${window.location.origin}${window.location.pathname}/event_times${window.location.search}#products` } window.fbAsyncInit = function () { if (gon.fb_app_id) { return FB.init({ appId: gon.fb_app_id, cookie: true, }); } }; $(() => { // disable if no app id if (gon.fb_app_id) { $('body').prepend('
'); $.getScript(`${window.location.protocol}//connect.facebook.net/en_US/all.js`, () => { let share_facebook; share_facebook = function () { return FB.ui({ method: 'share', href: gon.social_link, }, response => response); }; return $('a#facebook-share').click((e) => { e.preventDefault(); return share_facebook(); }); }); } // twitter $('a#twitter-share').attr('href', `http://twitter.com/intent/tweet?text=${encodeURIComponent(`${gon.event_name} - `)}&url=${encodeURI(gon.social_link)}`); $.getScript(`${window.location.protocol}//platform.twitter.com/widgets.js`, () => { let share_twitter; share_twitter = function (e) { return e; }; return twttr.events.bind('tweet', share_twitter); }); });