src/Plugin.php
private function _configureAssetThumbnails()
	{
		Event::on(
			Assets::class,
			Assets::EVENT_GET_ASSET_THUMB_URL,
			function(GetAssetThumbUrlEvent $event)
			{
				$embeddedAsset = $this->methods->getEmbeddedAsset($event->asset);
				$thumbSize = max($event->width, $event->height);
				$thumbnailUrl = $embeddedAsset ? $this->_getThumbnailUrl($embeddedAsset, $thumbSize) : null;

				if ($thumbnailUrl)
				{
					$event->url = $thumbnailUrl;
				}
			}
		);
	}
private function _configureAssetThumbnails()
	{
		Event::on(
			Assets::class,
			Assets::EVENT_GET_ASSET_THUMB_URL,
			function(GetAssetThumbUrlEvent $event)
			{
				$embeddedAsset = $this->methods->getEmbeddedAsset($event->asset);
				$thumbSize = max($event->width, $event->height);
				$thumbnailUrl = $embeddedAsset ? $this->_getThumbnailUrl($embeddedAsset, $thumbSize) : null;

				if ($thumbnailUrl)
				{
					$event->url = $thumbnailUrl;
				}
			}
		);
	}
private function _configureAssetThumbnails ( ) { Event :: on ( Assets :: class , Assets :: EVENT_GET_ASSET_THUMB_URL , function ( GetAssetThumbUrlEvent $ event ) { $ embeddedAsset = $ this -> methods -> getEmbeddedAsset ( $ event -> asset ) ; $ thumbSize = max ( $ event -> width , $ event -> height ) ; $ thumbnailUrl = $ embeddedAsset ? $ this -> _getThumbnailUrl ( $ embeddedAsset , $ thumbSize ) : null ; if ( $ thumbnailUrl ) { $ event -> url = $ thumbnailUrl ; } } ) ; }
Sets the embedded asset thumbnails on asset elements in the control panel.
Sets the embedded asset thumbnails on asset elements in the control panel .