From a2da532e0789e5f39c5c9bbe29a130956de5b139 Mon Sep 17 00:00:00 2001 From: Sukhwinder Dhillon Date: Tue, 12 Sep 2023 11:32:21 +0200 Subject: [PATCH] DetailsActions: Only add `data-action-item` attr if list is an `.action-list` --- library/Icingadb/Common/DetailActions.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/library/Icingadb/Common/DetailActions.php b/library/Icingadb/Common/DetailActions.php index bc62f48a8..b182b1f26 100644 --- a/library/Icingadb/Common/DetailActions.php +++ b/library/Icingadb/Common/DetailActions.php @@ -133,7 +133,9 @@ public function addMultiselectFilterAttribute(BaseHtmlElement $element, Filter\R public function addDetailFilterAttribute(BaseHtmlElement $element, Filter\Rule $filter): self { $element->getAttributes() - ->set('data-action-item', true) + ->registerAttributeCallback('data-action-item', function () { + return ! $this->getDetailActionsDisabled(); + }) ->registerAttributeCallback('data-icinga-detail-filter', function () use ($filter) { return $this->getDetailActionsDisabled() ? null : QueryString::render($filter); });