mirror of
https://github.com/silverstripe/silverstripe-userforms.git
synced 2024-10-22 17:05:42 +02:00
CSS hide when ShowOnLoad false
This commit is contained in:
parent
c37f3dcfc5
commit
4451d0c94d
@ -766,9 +766,6 @@ JS
|
|||||||
|
|
||||||
$result .= <<<EOS
|
$result .= <<<EOS
|
||||||
\n
|
\n
|
||||||
//Initial state
|
|
||||||
$('{$target}').{$initialState}();
|
|
||||||
|
|
||||||
$('.userform').on('{$events}',
|
$('.userform').on('{$events}',
|
||||||
"{$selectors}",
|
"{$selectors}",
|
||||||
function (){
|
function (){
|
||||||
|
@ -862,6 +862,11 @@ class EditableFormField extends DataObject
|
|||||||
$field->addExtraClass($this->ExtraClass);
|
$field->addExtraClass($this->ExtraClass);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if ShowOnLoad is false hide the field
|
||||||
|
if (!$this->ShowOnLoad) {
|
||||||
|
$field->addExtraClass($this->ShowOnLoadNice());
|
||||||
|
}
|
||||||
|
|
||||||
// if this field has a placeholder
|
// if this field has a placeholder
|
||||||
if ($this->Placeholder) {
|
if ($this->Placeholder) {
|
||||||
$field->setAttribute('placeholder', $this->Placeholder);
|
$field->setAttribute('placeholder', $this->Placeholder);
|
||||||
|
@ -72,3 +72,7 @@
|
|||||||
margin-bottom: 5px;
|
margin-bottom: 5px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.userform .field.hide {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user