Skip to content

Commit

Permalink
bug #5903 Fix th default CSS class applied to global actions (javiere…
Browse files Browse the repository at this point in the history
…guiluz)

This PR was merged into the 4.x branch.

Discussion
----------

Fix th default CSS class applied to global actions

Bug introduced in #5899.

Commits
-------

ddbea97 Fix th default CSS class applied to global actions
  • Loading branch information
javiereguiluz committed Sep 3, 2023
2 parents b1eda22 + ddbea97 commit f45f13f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Factory/ActionFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,17 @@ public function processGlobalActions(?ActionConfigDto $actionsDto = null): Actio
throw new \RuntimeException(sprintf('Batch actions can be added only to the "index" page, but the "%s" batch action is defined in the "%s" page.', $actionDto->getName(), $currentPage));
}

// if CSS class hasn't been overridden, apply the default ones
if ('' === $actionDto->getCssClass()) {
$actionDto->setCssClass('btn action-'.$actionDto->getName());
}

// these are the additional custom CSS classes defined via addCssClass()
// which are always appended to the CSS classes (default ones or custom ones)
if ('' !== $addedCssClass = $actionDto->getAddedCssClass()) {
$actionDto->setCssClass($actionDto->getCssClass().' '.$addedCssClass);
}

$globalActions[] = $this->processAction($currentPage, $actionDto);
}

Expand Down

0 comments on commit f45f13f

Please sign in to comment.