mirror of
https://github.com/humhub/humhub.git
synced 2025-04-21 07:31:53 +02:00
Fix: Modal options backdrop
and keyboard
deactivation has no effect
This commit is contained in:
parent
294215560e
commit
e36b00ac94
@ -15,7 +15,7 @@ HumHub Change Log
|
||||
- Fix: WallEntry of global content throws error
|
||||
- Fix: `ActivityAsset` does not depend on `StreamAsset`
|
||||
- Fix: Uploaded png preview files lose transparency
|
||||
|
||||
- Fix: Modal options `backdrop` and `keyboard` deactivation has no effect
|
||||
|
||||
1.3.10 (February 22, 2019)
|
||||
---------------------------
|
||||
|
@ -37,17 +37,12 @@ class ModalDialog extends Modal
|
||||
}
|
||||
|
||||
//The x close button is rendered by default either if forced by showClose or a headertext is given
|
||||
$showClose = ($this->showClose != null) ? $this->showClose : ($this->header != null);
|
||||
$showClose = $this->showClose ?: ($this->header !== null);
|
||||
|
||||
$bodyClass = 'modal-body';
|
||||
$bodyClass .= ($this->centerText) ? ' text-center' : '';
|
||||
$bodyClass .= $this->centerText ? ' text-center' : '';
|
||||
|
||||
$this->initialLoader = ($this->initialLoader ==! null) ? $this->initialLoader : ($this->body === null);
|
||||
|
||||
$modalData = '';
|
||||
$modalData .= !$this->closable || !$this->backdrop ? 'data-backdrop="static"' : '';
|
||||
$modalData .= !$this->closable || !$this->keyboard ? 'data-keyboard="false"' : '';
|
||||
$modalData .= $this->show ? 'data-show="true"' : '';
|
||||
|
||||
return $this->render('modalDialog', [
|
||||
'header' => $this->header,
|
||||
@ -64,8 +59,9 @@ class ModalDialog extends Modal
|
||||
public function getAttributes()
|
||||
{
|
||||
$dialogClass = 'modal-dialog';
|
||||
$dialogClass .= ($this->size != null) ? ' modal-dialog-'.$this->size : '';
|
||||
$dialogClass .= ($this->animation != null) ? ' animated '.$this->animation : '';
|
||||
$dialogClass .= $this->size ? ' modal-dialog-'.$this->size : '';
|
||||
$dialogClass .= $this->animation ? ' animated '.$this->animation : '';
|
||||
$dialogClass .= ' '.$this->dialogClass;
|
||||
|
||||
return [
|
||||
'class' => $dialogClass
|
||||
@ -74,8 +70,8 @@ class ModalDialog extends Modal
|
||||
public function getData()
|
||||
{
|
||||
return [
|
||||
'backdrop' => (!$this->closable || $this->backdrop === false) ? "static" : $this->backdrop,
|
||||
'keyboard' => (!$this->closable || !$this->keyboard) ? "false" : 'true',
|
||||
'backdrop' => (!$this->closable || $this->backdrop === false) ? 'static' : $this->backdrop,
|
||||
'keyboard' => (!$this->closable || !$this->keyboard) ? 'false' : 'true',
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -294,6 +294,7 @@ humhub.module('ui.modal', function (module, require, $) {
|
||||
if (!this.$.data('bs.modal')) {
|
||||
this.$.modal(this.options);
|
||||
} else {
|
||||
this.set(this.options);
|
||||
this.$.modal('show');
|
||||
}
|
||||
this.focus();
|
||||
@ -392,8 +393,8 @@ humhub.module('ui.modal', function (module, require, $) {
|
||||
this.getDialog().addClass('modal-dialog-'+this.options.size);
|
||||
}
|
||||
|
||||
this.options.backdrop = options.backdrop || true;
|
||||
this.options.keyboard = options.keyboard || true;
|
||||
this.options.backdrop = object.defaultValue(options.backdrop, true);
|
||||
this.options.keyboard = object.defaultValue(options.keyboard, true);
|
||||
|
||||
if (this.$.data('bs.modal')) {
|
||||
this.$.data('bs.modal').options = this.options;
|
||||
|
Loading…
x
Reference in New Issue
Block a user