mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Fixed DatetimeField formatting (single row, smaller field)
Also removed the arbitrary right-floating of fields within a fieldgroup
This commit is contained in:
parent
1acb416a7f
commit
b350ded87c
@ -231,7 +231,6 @@ form.small .field input.text, form.small .field textarea, form.small .field sele
|
||||
.fieldgroup .fieldgroup-field { float: left; display: block; padding: 8px 8px 0 0; }
|
||||
.fieldgroup .fieldgroup-field .field { border: none; padding-bottom: 0; }
|
||||
.fieldgroup .fieldgroup-field label { margin-left: 0; margin-right: 1em; width: auto; }
|
||||
.fieldgroup .fieldgroup-field input, .fieldgroup .fieldgroup-field textarea { float: right; }
|
||||
.fieldgroup.stacked .fieldgroup-field { float: none; }
|
||||
|
||||
.ss-toggle { margin: 8px 0; }
|
||||
|
@ -522,10 +522,6 @@ form.small .field, .field.small {
|
||||
margin-right: 1em;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
input, textarea {
|
||||
float: right;
|
||||
}
|
||||
}
|
||||
|
||||
&.stacked {
|
||||
|
@ -1,5 +1,5 @@
|
||||
.datetime .middleColumn .middleColumn { margin: 0; padding: 0; clear: none; float: left; }
|
||||
|
||||
.datetime .date .middleColumn { width: 20em; }
|
||||
.datetime .date .middleColumn { width: 12em; }
|
||||
|
||||
.datetime .time .middleColumn { width: 10em; }
|
||||
.datetime .time .middleColumn { width: 15em; }
|
||||
|
@ -58,8 +58,10 @@ class DatetimeField extends FormField {
|
||||
public function __construct($name, $title = null, $value = ""){
|
||||
$this->config = self::$default_config;
|
||||
|
||||
$this->dateField = DateField::create($name . '[date]', false);
|
||||
$this->timeField = TimeField::create($name . '[time]', false);
|
||||
$this->dateField = DateField::create($name . '[date]', false)
|
||||
->addExtraClass('fieldgroup-field');
|
||||
$this->timeField = TimeField::create($name . '[time]', false)
|
||||
->addExtraClass('fieldgroup-field');
|
||||
$this->timezoneField = new HiddenField($this->getName() . '[timezone]');
|
||||
|
||||
parent::__construct($name, $title, $value);
|
||||
@ -80,6 +82,7 @@ class DatetimeField extends FormField {
|
||||
'datetimeorder' => $this->getConfig('datetimeorder'),
|
||||
);
|
||||
$config = array_filter($config);
|
||||
$this->addExtraClass('fieldgroup');
|
||||
$this->addExtraClass(Convert::raw2json($config));
|
||||
|
||||
return parent::FieldHolder($properties);
|
||||
|
@ -6,9 +6,12 @@
|
||||
}
|
||||
|
||||
.datetime .date .middleColumn {
|
||||
width: 20em;
|
||||
// Fits a standard date, as well as most abbreviated month names
|
||||
width: 12em;
|
||||
}
|
||||
|
||||
.datetime .time .middleColumn {
|
||||
width: 10em;
|
||||
// make room to accommodate for additional modifier fields,
|
||||
// such as a dropdown field to preselect time
|
||||
width: 15em;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user