Skip to content

Commit

Permalink
Merge pull request #28 from tardinha/master
Browse files Browse the repository at this point in the history
Fix: update templates to allow editable form field visibility to be toggled
  • Loading branch information
nyeholt authored Oct 9, 2023
2 parents b4e37e4 + ca62b25 commit d230dbc
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/editableformfields/EditableDependentDynamicListField.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ public function getFormField()
$field = DropdownField::create($this->Name, $this->Title, array());
}
$field
->setFieldHolderTemplate('UserFormsField_holder')
->setTemplate('UserFormsDropdownField');
->setFieldHolderTemplate(EditableFormField::class . '_holder')
->setTemplate(__CLASS__);
$this->doUpdateFormField($field);
return $field;
}
Expand Down
4 changes: 2 additions & 2 deletions src/editableformfields/EditableDynamicListField.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ public function getCMSFields()
public function getFormField()
{
$field = DynamicListField::create($this->Name, $this->Title, $this->ListTitle)
->setFieldHolderTemplate('UserFormsField_holder')
->setTemplate('UserFormsDropdownField');
->setFieldHolderTemplate(EditableFormField::class . '_holder')
->setTemplate(__CLASS__);
if ($this->UseEmptyString) {
$field->setEmptyString(($this->EmptyString) ? $this->EmptyString : '');
}
Expand Down
2 changes: 0 additions & 2 deletions src/fields/DynamicListField.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ public function __construct($name, $title = null, $source = null, $value = "", $
}
}

$this->addExtraClass('dropdown');

parent::__construct($name, $title, $source, $value, $form, $emptyString);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<% include SilverStripe/UserForms/Model/EditableFormField/EditableDropdown %>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<% include SilverStripe/UserForms/Model/EditableFormField/EditableDropdown %>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<% include SilverStripe/UserForms/Model/EditableFormField_holder %>

0 comments on commit d230dbc

Please sign in to comment.