Improve assets loading: remove http call to load task colors and async load of app.js
This commit is contained in:
@@ -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>';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user