Add ability to null asset broadcasting from AJAX
This commit is contained in:
parent
f2699a7039
commit
b65a653176
|
|
@ -28,6 +28,17 @@ trait AssetMaker
|
|||
*/
|
||||
public $assetPath;
|
||||
|
||||
/**
|
||||
* Disables the use, and subequent broadcast, of assets. This is useful
|
||||
* to call during an AJAX request to speed things up. This method works
|
||||
* by specifically targeting the hasAssetsDefined method.
|
||||
* @return void
|
||||
*/
|
||||
public function clearAssetDefinitions()
|
||||
{
|
||||
$this->assets = ['js'=>[], 'css'=>[], 'rss'=>[]];
|
||||
}
|
||||
|
||||
/**
|
||||
* Outputs <link> and <script> tags to load assets previously added with addJs and addCss method calls
|
||||
* @param string $type Return an asset collection of a given type (css, rss, js) or null for all.
|
||||
|
|
|
|||
Loading…
Reference in New Issue