From 7c0a1a5fbda41a1d9eb8af86546bd024275b7301 Mon Sep 17 00:00:00 2001
From: Michael Vickers <michaelvickers.uk@gmail.com>
Date: Sat, 9 Jun 2018 11:03:03 +0100
Subject: Defer javascript files by default

Prevent scripts blocking browser HTML parsing. The modern method instead of moving scripts to the end of the body tag as suggested in kanboard/kanboard#3829
---
 app/Helper/AssetHelper.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'app/Helper')

diff --git a/app/Helper/AssetHelper.php b/app/Helper/AssetHelper.php
index dad1448a..c2ab8551 100644
--- a/app/Helper/AssetHelper.php
+++ b/app/Helper/AssetHelper.php
@@ -21,7 +21,7 @@ class AssetHelper extends Base
      */
     public function js($filename, $async = false)
     {
-        return '<script '.($async ? 'async' : '').' type="text/javascript" src="'.$this->helper->url->dir().$filename.'?'.filemtime($filename).'"></script>';
+        return '<script '.($async ? 'async' : '').' defer type="text/javascript" src="'.$this->helper->url->dir().$filename.'?'.filemtime($filename).'"></script>';
     }
 
     /**
-- 
cgit v1.2.3