diff options
author | Frederic Guillot <fred@kanboard.net> | 2015-06-23 20:47:46 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2015-06-23 20:47:46 -0400 |
commit | 948ebb242490092c5a7e187c3b7813134b047d5e (patch) | |
tree | 28ed10f76c648ad8c70ffcc74e85c6de1ad8cfde /app/Helper | |
parent | cdd2080fc0041d71b99862a9aa3542fe6150c6c4 (diff) |
Improve assets loading: remove http call to load task colors and async load of app.js
Diffstat (limited to 'app/Helper')
-rw-r--r-- | app/Helper/Asset.php | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/app/Helper/Asset.php b/app/Helper/Asset.php index fe285081..1b1e47c5 100644 --- a/app/Helper/Asset.php +++ b/app/Helper/Asset.php @@ -16,9 +16,9 @@ class Asset extends \Core\Base * @param string $filename Filename * @return string */ - public function js($filename) + public function js($filename, $async = false) { - return '<script type="text/javascript" src="'.$filename.'?'.filemtime($filename).'"></script>'; + return '<script '.($async ? 'async' : '').' type="text/javascript" src="'.$filename.'?'.filemtime($filename).'"></script>'; } /** @@ -48,4 +48,15 @@ class Asset extends \Core\Base return ''; } + + /** + * Get CSS for task colors + * + * @access public + * @return string + */ + public function colorCss() + { + return '<style>'.$this->color->getCss().'</style>'; + } } |