chg: [BootstrapHelper:modal] Added support of scrolling in modal body

- For the pleasure of @iglocska
develop-unstable
Sami Mokaddem 2023-01-19 10:24:59 +01:00
parent 7cda322223
commit fb418ca0b4
No known key found for this signature in database
GPG Key ID: 164C473F627A06FA
1 changed files with 6 additions and 0 deletions

View File

@ -17,6 +17,7 @@ use App\View\Helper\BootstrapGeneric;
* - body: The body of the modal
* - bodyHtml: The HTML body of the modal
* - footerHtml: The HTML footer of the modal. Override the $type option
* - dialogScrollable: Allows to scroll the modal body
* - modalClass, headerClass, footerClass: Classes to be applied to these modal sections
* - type: Control the type of actions available.
* Valid values: 'ok-only', 'confirm', 'custom'
@ -139,6 +140,7 @@ class BootstrapModal extends BootstrapGeneric
'body' => '',
'bodyHtml' => null,
'footerHtml' => null,
'dialogScrollable' => true,
'modalClass' => [''],
'headerClass' => [''],
'bodyClass' => [''],
@ -176,6 +178,10 @@ class BootstrapModal extends BootstrapGeneric
$this->options['bodyClass'] = $this->convertToArrayIfNeeded($this->options['bodyClass']);
$this->options['footerClass'] = $this->convertToArrayIfNeeded($this->options['footerClass']);
if (!empty($this->options['dialogScrollable'])) {
$this->options['modalClass'][] = 'modal-dialog-scrollable';
}
$possiblVariants = ['header-variant', 'body-variant', 'footer-variant'];
foreach ($possiblVariants as $possiblVariant) {
if (!empty($this->options[$possiblVariant])) {