diff --git a/Forms/GridField/GridFieldDetailForm_ItemRequest.php b/Forms/GridField/GridFieldDetailForm_ItemRequest.php index 257630fd7..c512c0354 100644 --- a/Forms/GridField/GridFieldDetailForm_ItemRequest.php +++ b/Forms/GridField/GridFieldDetailForm_ItemRequest.php @@ -254,7 +254,7 @@ class GridFieldDetailForm_ItemRequest extends RequestHandler 'type' => 'Includes', 'SilverStripe\\Admin\\LeftAndMain_EditForm', ]); - $form->addExtraClass('cms-content cms-edit-form center'); + $form->addExtraClass('cms-content cms-edit-form center flexbox-area-grow'); $form->setAttribute('data-pjax-fragment', 'CurrentForm Content'); if ($form->Fields()->hasTabSet()) { $form->Fields()->findOrMakeTab('Root')->setTemplate('SilverStripe\\Forms\\CMSTabSet'); diff --git a/admin/client/dist/styles/bundle.css b/admin/client/dist/styles/bundle.css index 9ac0da5f2..115767184 100644 --- a/admin/client/dist/styles/bundle.css +++ b/admin/client/dist/styles/bundle.css @@ -8623,6 +8623,10 @@ form.nostyle .TreeDropdownField,form.nostyle input.text,form.nostyle select,form max-width:auto; } +fieldset{ + width:100%; +} + .field.ui-tabs{ border-bottom:0; } diff --git a/admin/client/src/components/FieldHolder/FieldHolder.js b/admin/client/src/components/FieldHolder/FieldHolder.js index 53a054ea9..ba9ef7616 100644 --- a/admin/client/src/components/FieldHolder/FieldHolder.js +++ b/admin/client/src/components/FieldHolder/FieldHolder.js @@ -60,7 +60,7 @@ function fieldHolder(Field) { // The extraClass property is defined on both the holder and element // for legacy reasons (same behaviour as PHP rendering) const classNames = [ - 'field form__field-holder', + 'field', this.props.extraClass, ]; if (this.props.readOnly) { @@ -81,7 +81,9 @@ function fieldHolder(Field) { return ( {this.getLeftTitle()} - +
+ +
{this.getRightTitle()} {this.getDescription()}
diff --git a/admin/client/src/legacy/LeftAndMain.Preview.js b/admin/client/src/legacy/LeftAndMain.Preview.js index 278feda96..4c56e6024 100644 --- a/admin/client/src/legacy/LeftAndMain.Preview.js +++ b/admin/client/src/legacy/LeftAndMain.Preview.js @@ -119,6 +119,8 @@ $.entwine('ss.preview', function($){ if(save !== false) this.saveState('mode', modeName); + this.redraw(); + return this; }, @@ -289,6 +291,10 @@ $.entwine('ss.preview', function($){ } }, + onforcecontent: function () { + this.changeMode('content', false); + }, + onenable: function () { var $viewModeSelector = $('.preview-mode-selector'); diff --git a/admin/client/src/legacy/LeftAndMain.js b/admin/client/src/legacy/LeftAndMain.js index b63e97113..e8f5c0608 100644 --- a/admin/client/src/legacy/LeftAndMain.js +++ b/admin/client/src/legacy/LeftAndMain.js @@ -336,15 +336,16 @@ $.entwine('ss', function($) { } else { preview.css('min-width', options.minPreviewWidth); } - $('.cms-preview').trigger('enable'); + preview.trigger('enable'); } else { - $('.cms-preview').trigger('disable'); + preview.trigger('disable'); if (mode == 'split') { // force change mode and leave it redraw after - this.contentViewMode(); + preview.trigger('forcecontent'); return true; } } + this.addClass('cms-container--' + mode + '-mode'); return false; }, diff --git a/admin/client/src/styles/legacy/_forms.scss b/admin/client/src/styles/legacy/_forms.scss index 2f0e8d6e8..d51ccb64c 100644 --- a/admin/client/src/styles/legacy/_forms.scss +++ b/admin/client/src/styles/legacy/_forms.scss @@ -14,9 +14,10 @@ form.nostyle { @include clear-form-field-styles(); } -// fieldset { -// width: 100%; -// } +// need this for consistent
behaviour +fieldset { + width: 100%; +} .field { // TODO convert to .form-group diff --git a/admin/code/ModelAdmin.php b/admin/code/ModelAdmin.php index f8fef5239..6071f1154 100644 --- a/admin/code/ModelAdmin.php +++ b/admin/code/ModelAdmin.php @@ -173,7 +173,7 @@ abstract class ModelAdmin extends LeftAndMain { new FieldList($listField), new FieldList() )->setHTMLID('Form_EditForm'); - $form->addExtraClass('cms-edit-form cms-panel-padded center'); + $form->addExtraClass('cms-edit-form cms-panel-padded center flexbox-area-grow'); $form->setTemplate($this->getTemplatesWithSuffix('_EditForm')); $editFormAction = Controller::join_links($this->Link($this->sanitiseClassName($this->modelClass)), 'EditForm'); $form->setFormAction($editFormAction); diff --git a/admin/templates/SilverStripe/Admin/Includes/ModelAdmin_Content.ss b/admin/templates/SilverStripe/Admin/Includes/ModelAdmin_Content.ss index 1a86d17e9..627261d14 100644 --- a/admin/templates/SilverStripe/Admin/Includes/ModelAdmin_Content.ss +++ b/admin/templates/SilverStripe/Admin/Includes/ModelAdmin_Content.ss @@ -1,4 +1,4 @@ -
+