Skip to content

Commit

Permalink
action-list.js: Don't add footer for list in .controls (#867)
Browse files Browse the repository at this point in the history
fixes #866
  • Loading branch information
nilmerg authored Sep 12, 2023
2 parents 959f06c + 5c30e53 commit 84eeeaa
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions application/controllers/HostsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ public function detailsAction()
$this->addControl(
(new HostList($results))
->setViewMode('minimal')
->setDetailActionsDisabled()
);
$this->addControl(new ShowMore(
$results,
Expand Down
1 change: 1 addition & 0 deletions application/controllers/ServicesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ public function detailsAction()
$this->addControl(
(new ServiceList($results))
->setViewMode('minimal')
->setDetailActionsDisabled()
);
$this->addControl(new ShowMore(
$results,
Expand Down
4 changes: 3 additions & 1 deletion library/Icingadb/Common/DetailActions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down
2 changes: 1 addition & 1 deletion public/js/action-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,7 @@
}

if (isTopLevelContainer) {
let footerList = list ?? container.querySelector('.action-list');
let footerList = list ?? container.querySelector('.content > .action-list');
if (footerList) {
_this.addSelectionCountToFooter(footerList);
}
Expand Down

0 comments on commit 84eeeaa

Please sign in to comment.