From 96cde0f04c4de1b6d90976839826ee22b8a6a4b5 Mon Sep 17 00:00:00 2001 From: Scott Hutchinson Date: Mon, 5 Feb 2018 12:08:24 +1300 Subject: [PATCH] FIX: Ensure display rules work correctly for EditableFormHeading (#712) --- code/model/editableformfields/EditableFormHeading.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/code/model/editableformfields/EditableFormHeading.php b/code/model/editableformfields/EditableFormHeading.php index 7a06d8b..4cfe598 100644 --- a/code/model/editableformfields/EditableFormHeading.php +++ b/code/model/editableformfields/EditableFormHeading.php @@ -74,10 +74,15 @@ class EditableFormHeading extends EditableFormField // Since this field expects raw html, safely escape the user data prior $field->setRightTitle(Convert::raw2xml($this->RightTitle)); } + // if this field has an extra class if ($this->ExtraClass) { $field->addExtraClass($this->ExtraClass); } + + if (!$this->ShowOnLoad) { + $field->addExtraClass($this->ShowOnLoadNice()); + } } public function showInReports() @@ -95,6 +100,11 @@ class EditableFormHeading extends EditableFormField return "$(\":header[data-id='{$this->Name}']\")"; } + public function getSelectorOnly() + { + return "[data-id={$this->Name}]"; + } + public function getLevel() { return $this->getField('Level') ?: 3;