Skip to content

Commit

Permalink
Merge branch '4.x' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
bencroker committed Aug 4, 2024
2 parents 8ea0934 + 501338b commit 4b0a28e
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/Blitz.php
Original file line number Diff line number Diff line change
Expand Up @@ -589,13 +589,15 @@ function(RegisterComponentTypesEvent $event) {
private function registerSidebarPanels(): void
{
foreach (ElementSidebarHelper::ELIGIBLE_ELEMENT_TYPES as $elementType) {
Event::on($elementType, $elementType::EVENT_DEFINE_SIDEBAR_HTML,
function(DefineHtmlEvent $event) {
/** @var Element $element */
$element = $event->sender;
$event->html .= ElementSidebarHelper::getSidebarHtml($element);
},
);
if (class_exists($elementType)) {
Event::on($elementType, $elementType::EVENT_DEFINE_SIDEBAR_HTML,
function(DefineHtmlEvent $event) {
/** @var Element $element */
$element = $event->sender;
$event->html .= ElementSidebarHelper::getSidebarHtml($element);
},
);
}
}

Event::on(Element::class, Element::EVENT_DEFINE_SIDEBAR_HTML,
Expand Down

0 comments on commit 4b0a28e

Please sign in to comment.