Browse code

Dynamically add asset files for animations to template

Benjamin Roth authored on24/04/2020 15:23:31
Showing1 changed files
... ...
@@ -38,6 +38,10 @@ class TemplateListener implements FrameworkAwareInterface
38 38
     }
39 39
     if ($template->es_animate)
40 40
     {
41
+      $assetsDir = 'web/bundles/esalesmediacontenthelper';
42
+      $GLOBALS['TL_CSS'][] = $assetsDir . '/css/animate.scss||static';
43
+      $GLOBALS['TL_BODY'][] = '<script src="' . $assetsDir . '/js/inView_animate.js"></script>';
44
+
41 45
       $template->class = trim($template->class . ' is-animated ' . $template->es_animate_type);
42 46
 
43 47
       if ($template->es_animate_children)