mirror of
https://github.com/wintercms/winter.git
synced 2024-06-28 05:33:29 +02:00
Ensure that FormWidgets are correctly initialized with previewMode even on AJAX requests
This commit is contained in:
parent
1b3263d4c7
commit
5853cc54c4
@ -139,6 +139,11 @@ class FormController extends ControllerBehavior
|
||||
*/
|
||||
$this->formWidget = $this->makeWidget('Backend\Widgets\Form', $config);
|
||||
|
||||
// Setup the default preview mode on form initialization if the context is preview
|
||||
if ($config->context === 'preview') {
|
||||
$this->formWidget->previewMode = true;
|
||||
}
|
||||
|
||||
$this->formWidget->bindEvent('form.extendFieldsBefore', function () {
|
||||
$this->controller->formExtendFieldsBefore($this->formWidget);
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user