Loading modules/cookies_facebook_pixel/cookies_facebook_pixel.module +2 −1 Original line number Diff line number Diff line Loading @@ -61,7 +61,8 @@ function cookies_facebook_pixel_page_attachments(&$page) { function cookies_facebook_pixel_js_alter(array &$javascript, AttachedAssetsInterface $assets) { $doKo = CookiesKnockOutService::getInstance()->doKnockOut(); if ($doKo) { $script = 'modules/contrib/facebook_pixel/js/facebook_pixel.js'; $modulePath = \Drupal::service('module_handler')->getModule('facebook_pixel')->getPath(); $script = $modulePath . '/js/facebook_pixel.js'; if (isset($javascript[$script])) { $javascript[$script]['preprocess'] = false; $javascript[$script]['attributes']['type'] = 'application/json'; Loading modules/cookies_facebook_pixel/js/cookies_facebook_pixel.js +6 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,12 @@ } newScript.innerHTML = content; script.parentNode.replaceChild(newScript, script); // We have to call the attach() from facebook_pixel manually, // otherwise the script won't be initialized. if (Drupal.behaviors.facebook_pixel.attach && typeof Drupal.behaviors.facebook_pixel.attach === 'function') { Drupal.behaviors.facebook_pixel.attach(document); } } } }, Loading Loading
modules/cookies_facebook_pixel/cookies_facebook_pixel.module +2 −1 Original line number Diff line number Diff line Loading @@ -61,7 +61,8 @@ function cookies_facebook_pixel_page_attachments(&$page) { function cookies_facebook_pixel_js_alter(array &$javascript, AttachedAssetsInterface $assets) { $doKo = CookiesKnockOutService::getInstance()->doKnockOut(); if ($doKo) { $script = 'modules/contrib/facebook_pixel/js/facebook_pixel.js'; $modulePath = \Drupal::service('module_handler')->getModule('facebook_pixel')->getPath(); $script = $modulePath . '/js/facebook_pixel.js'; if (isset($javascript[$script])) { $javascript[$script]['preprocess'] = false; $javascript[$script]['attributes']['type'] = 'application/json'; Loading
modules/cookies_facebook_pixel/js/cookies_facebook_pixel.js +6 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,12 @@ } newScript.innerHTML = content; script.parentNode.replaceChild(newScript, script); // We have to call the attach() from facebook_pixel manually, // otherwise the script won't be initialized. if (Drupal.behaviors.facebook_pixel.attach && typeof Drupal.behaviors.facebook_pixel.attach === 'function') { Drupal.behaviors.facebook_pixel.attach(document); } } } }, Loading