Fix: Reset modal dialog size + add size option

Enh: Added `size` option `ui.modal.Modal.set()`
This commit is contained in:
buddh4 2017-07-24 23:50:08 +02:00
parent fabfd69c47
commit a035c4ebef
4 changed files with 17 additions and 10 deletions

View File

@ -39,6 +39,11 @@ HumHub Change Log
- Enh: Allow `$adminOnly` for User base ContentContainerController Controller
- Enh: Added `ContentContainerActiveRecord::getDefaultContentVisibility()` and `User::getDefaultContentVisibility()`
- Enh: Added automatic Notification Class loading by convention. No need to overwrite `Module::getNotifications()`
- Enh: Added `ContentActiveRecord::getIcon()` for adding an badge icon to WallEntry content type badge
- Enh: Added `ContentActiveRecord::getLabels()` for managing WallEntry labels (badges)
- Enh: Added `Label` widget for creating sortable labels
- Fix: Reset modal dialog size + add `size` option
- Enh: Added `size` option `ui.modal.Modal.set()`
1.2.1 (June 17, 2017)
- Fix: Invite error in french language

View File

@ -31,11 +31,6 @@ use yii\helpers\Url;
*/
class ModalButton extends Button
{
public function init()
{
parent::init(); // TODO: Change the autogenerated stub
}
/**
* @param $url
* @return $this
@ -84,6 +79,4 @@ class ModalButton extends Button
{
return $this->options(['data-modal-close' => '']);
}
}

View File

@ -1,5 +1,7 @@
<?php
use humhub\libs\Html;
use humhub\widgets\LoaderWidget;
?>
<!-- Dialog -->
@ -27,7 +29,7 @@ use humhub\libs\Html;
<?= $body ?>
<?php endif; ?>
<?php if ($initialLoader): ?>
<?php echo \humhub\widgets\LoaderWidget::widget(); ?>
<?= LoaderWidget::widget(); ?>
<?php endif; ?>
</div>
@ -38,4 +40,5 @@ use humhub\libs\Html;
</div>
<?php endif; ?>
<?php endif; ?>
<?= Html::endTag('div') ?>
</div>
<?= Html::endTag('div') ?>

View File

@ -143,6 +143,8 @@ humhub.module('ui.modal', function (module, require, $) {
loader.set(this.getBody());
this.isFilled = false;
this.getDialog().removeClass('modal-dialog-large modal-dialog-normal modal-dialog-small modal-dialog-extra-small modal-dialog-medium');
//reset listeners:
this.resetListener();
};
@ -384,6 +386,10 @@ humhub.module('ui.modal', function (module, require, $) {
this.setFooter(this.options.footer);
}
if(this.options.size) {
this.getDialog().addClass('modal-dialog-'+this.options.size);
}
this.options.backdrop = options.backdrop || true;
this.options.keyboard = options.keyboard || true;
@ -426,7 +432,7 @@ humhub.module('ui.modal', function (module, require, $) {
}
this.$.empty().append(content);
this.applyAdditions();
this.$.find('input[type="text"]:visible, textarea:visible, [contenteditable="true"]:visible').first().focus();
this.$.find('select:visible, input[type="text"]:visible, textarea:visible, [contenteditable="true"]:visible').first().focus();
this.checkAriaLabel();
this.updateDialogOptions();
this.$.scrollTop(0);