Skip to content

Commit

Permalink
Turbolinks compatibility (#1320)
Browse files Browse the repository at this point in the history
  • Loading branch information
tanthammar authored Jun 8, 2022
1 parent e7c3f56 commit 814b36a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/JavascriptRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ public function renderHead()
$cssRoute = preg_replace('/\Ahttps?:/', '', $cssRoute);
$jsRoute = preg_replace('/\Ahttps?:/', '', $jsRoute);

$html = "<link rel='stylesheet' type='text/css' property='stylesheet' href='{$cssRoute}'>";
$html .= "<script src='{$jsRoute}'></script>";
$html = "<link rel='stylesheet' type='text/css' property='stylesheet' href='{$cssRoute}' data-turbolinks-eval='false' data-turbo-eval='false'>";
$html .= "<script src='{$jsRoute}' data-turbolinks-eval='false' data-turbo-eval='false'></script>";

if ($this->isJqueryNoConflictEnabled()) {
$html .= '<script>jQuery.noConflict(true);</script>' . "\n";
$html .= '<script data-turbo-eval="false">jQuery.noConflict(true);</script>' . "\n";
}

$html .= $this->getInlineHtml();
Expand Down

0 comments on commit 814b36a

Please sign in to comment.