Fixed DatetimeField formatting (single row, smaller field)

Also removed the arbitrary right-floating of fields within a fieldgroup
This commit is contained in:
Ingo Schommer 2013-02-05 12:01:18 +01:00
parent 1acb416a7f
commit b350ded87c
5 changed files with 12 additions and 11 deletions

View File

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

View File

@ -522,10 +522,6 @@ form.small .field, .field.small {
margin-right: 1em;
width: auto;
}
input, textarea {
float: right;
}
}
&.stacked {

View File

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

View File

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

View File

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