Skip to content

Commit

Permalink
NEW option ...
Browse files Browse the repository at this point in the history
... to include inline vanilla JS.
The asset should have the following identifier: vanilla_xxx or vanillaCustom ...
  • Loading branch information
t3solution committed Jul 14, 2021
1 parent 1c6d501 commit 5c48ff3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Classes/EventListener/AssetRenderer/IsInline.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public function __invoke(BeforeJavaScriptsRenderingEvent $event): void

foreach ($assetJsInline as $library => $source) {

if ($library == 'lazyload' || $library == 'lazyloadmagnifying' || $library == 'codesnippetJsInline' ) {
if ($library == 'lazyload' || $library == 'lazyloadmagnifying' || $library == 'codesnippetJsInline' || substr($library, 0, 7) == 'vanilla' ) {
$js .= $source['source'] .PHP_EOL;
$event->getAssetCollector()->removeInlineJavaScript($library);
} elseif ( GeneralUtility::isFirstPartOfStr($library, 'background-video-') ) {
Expand Down Expand Up @@ -129,4 +129,4 @@ public function __invoke(BeforeJavaScriptsRenderingEvent $event): void
}
}
}
}
}

0 comments on commit 5c48ff3

Please sign in to comment.