mirror of
https://github.com/humhub/humhub.git
synced 2025-01-17 22:28:51 +01:00
Enh #3771: Added humhub\modules\ui\form\widgets\ActiveForm:acknowledge
flag
This commit is contained in:
parent
2d3b9bbceb
commit
a4f36adde8
@ -26,6 +26,7 @@ HumHub Change Log (DEVELOP)
|
||||
- Enh: Added `data-ui-addition` way of definint ui additions
|
||||
- Enh: Added `data-ui-addition` way of defining ui additions
|
||||
- Enh #3771: Added `data-ui-addition="acknowledgeForm"` in order to prevent page changes without save/confirmation
|
||||
- Enh #3771: Added `humhub\modules\ui\form\widgets\ActiveForm:acknowledge` flag
|
||||
|
||||
1.4
|
||||
---
|
||||
|
@ -28,4 +28,15 @@ class ActiveForm extends \yii\bootstrap\ActiveForm
|
||||
*/
|
||||
public $fieldClass = 'humhub\modules\ui\form\widgets\ActiveField';
|
||||
|
||||
public $acknowledge = false;
|
||||
|
||||
public function init()
|
||||
{
|
||||
parent::init();
|
||||
|
||||
if($this->acknowledge) {
|
||||
$this->options['data-ui-addition'] = 'acknowledgeForm';
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -353,7 +353,8 @@ humhub.module('client', function (module, require, $) {
|
||||
$(document).on('pjax:beforeSend.humhub_client', function(evt) {
|
||||
if ($form.serialize() !== state && !window.confirm(msg)) {
|
||||
evt.preventDefault();
|
||||
return;
|
||||
} else {
|
||||
offBeforeLoad();
|
||||
}
|
||||
})
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user