Fix selected view mode not reflected on button

Fix other ModelAdmin layout (test)
Fix fieldholder placement
This commit is contained in:
Christopher Joe 2016-10-10 11:39:24 +13:00 committed by Damian Mooyman
parent 89150c48e7
commit 7acb3b5fc2
8 changed files with 25 additions and 11 deletions

View File

@ -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');

View File

@ -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;
}

View File

@ -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 (
<FormGroup {...this.getHolderProps()}>
{this.getLeftTitle()}
<Field {...this.props} />
<div className="form__field-holder">
<Field {...this.props} />
</div>
{this.getRightTitle()}
{this.getDescription()}
</FormGroup>

View File

@ -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');

View File

@ -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;
},

View File

@ -14,9 +14,10 @@ form.nostyle {
@include clear-form-field-styles();
}
// fieldset {
// width: 100%;
// }
// need this for consistent <fieldset> behaviour
fieldset {
width: 100%;
}
.field { // TODO convert to .form-group

View File

@ -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);

View File

@ -1,4 +1,4 @@
<div class="cms-content cms-tabset center $BaseCSSClasses" data-layout-type="border" data-pjax-fragment="Content">
<div class="cms-content flexbox-area-grow cms-tabset center $BaseCSSClasses" data-layout-type="border" data-pjax-fragment="Content">
<div class="cms-content-header north">
<div class="cms-content-header-info">