chg: [bootstrap:collapse] Allow disabling card formating

develop-unstable
Sami Mokaddem 2023-02-14 10:30:46 +01:00
parent 881e116889
commit d4ad5f2fb3
No known key found for this signature in database
GPG Key ID: 164C473F627A06FA
1 changed files with 9 additions and 5 deletions

View File

@ -42,7 +42,7 @@ class BootstrapCollapse extends BootstrapGeneric
'horizontal' => false,
'class' => [],
'button' => [],
'card' => [],
'card' => false,
'attrs' => [],
];
@ -65,7 +65,7 @@ class BootstrapCollapse extends BootstrapGeneric
if ($this->options['open']) {
$this->options['class'][] = 'show';
}
if (empty($this->options['card']['bodyClass'])) {
if ($this->options['card'] !== false && empty($this->options['card']['bodyClass'])) {
$this->options['card']['bodyClass'] = ['p-0'];
}
if (empty($this->options['id'])) {
@ -104,9 +104,13 @@ class BootstrapCollapse extends BootstrapGeneric
private function genContent(): string
{
$cardConfig = $this->options['card'];
$cardConfig['bodyHTML'] = $this->content;
$content = $this->btHelper->card($cardConfig);
if (!empty($this->options['card'])) {
$cardConfig = $this->options['card'];
$cardConfig['bodyHTML'] = $this->content;
$content = $this->btHelper->card($cardConfig);
} else {
$content = $this->content;
}
$container = $this->node('div', [
'class' => $this->options['class'],
'id' => $this->options['id'],