Skip to content

Commit

Permalink
Update HtmlAssets.php
Browse files Browse the repository at this point in the history
  • Loading branch information
mlantz committed Aug 20, 2024
1 parent 982f844 commit de842e3
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/HtmlAssets.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,7 @@ protected function compileScripts($type, $nonce)

$function = "window.HtmlJS = () => { {$js} }";

$output .= "<!-- Html Scripts -->\n<script type=\"module\" {$nonce}>\n{$function}\n
document.addEventListener('DOMContentLoaded', (event) => { window.HtmlJS(); });
\n</script>\n";
$output .= "<!-- Html Scripts -->\n<script type=\"module\" {$nonce}>\n{$function}\nwindow.HtmlJS();\n</script>\n";
}

return $output;
Expand Down

0 comments on commit de842e3

Please sign in to comment.