From b65a65317659e2f4553d276b2367144f4ca1290a Mon Sep 17 00:00:00 2001 From: Samuel Georges Date: Sat, 16 Jan 2016 17:12:54 +1100 Subject: [PATCH] Add ability to null asset broadcasting from AJAX --- modules/system/traits/AssetMaker.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/modules/system/traits/AssetMaker.php b/modules/system/traits/AssetMaker.php index d62fe59f8..317768876 100644 --- a/modules/system/traits/AssetMaker.php +++ b/modules/system/traits/AssetMaker.php @@ -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 and