chg: [bootstrap:collapse] Allow disabling card formating
parent
881e116889
commit
d4ad5f2fb3
|
@ -42,7 +42,7 @@ class BootstrapCollapse extends BootstrapGeneric
|
||||||
'horizontal' => false,
|
'horizontal' => false,
|
||||||
'class' => [],
|
'class' => [],
|
||||||
'button' => [],
|
'button' => [],
|
||||||
'card' => [],
|
'card' => false,
|
||||||
'attrs' => [],
|
'attrs' => [],
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ class BootstrapCollapse extends BootstrapGeneric
|
||||||
if ($this->options['open']) {
|
if ($this->options['open']) {
|
||||||
$this->options['class'][] = 'show';
|
$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'];
|
$this->options['card']['bodyClass'] = ['p-0'];
|
||||||
}
|
}
|
||||||
if (empty($this->options['id'])) {
|
if (empty($this->options['id'])) {
|
||||||
|
@ -104,9 +104,13 @@ class BootstrapCollapse extends BootstrapGeneric
|
||||||
|
|
||||||
private function genContent(): string
|
private function genContent(): string
|
||||||
{
|
{
|
||||||
|
if (!empty($this->options['card'])) {
|
||||||
$cardConfig = $this->options['card'];
|
$cardConfig = $this->options['card'];
|
||||||
$cardConfig['bodyHTML'] = $this->content;
|
$cardConfig['bodyHTML'] = $this->content;
|
||||||
$content = $this->btHelper->card($cardConfig);
|
$content = $this->btHelper->card($cardConfig);
|
||||||
|
} else {
|
||||||
|
$content = $this->content;
|
||||||
|
}
|
||||||
$container = $this->node('div', [
|
$container = $this->node('div', [
|
||||||
'class' => $this->options['class'],
|
'class' => $this->options['class'],
|
||||||
'id' => $this->options['id'],
|
'id' => $this->options['id'],
|
||||||
|
|
Loading…
Reference in New Issue