Skip to content
Snippets Groups Projects
Commit ffc0ea23 authored by Peter Rotich's avatar Peter Rotich
Browse files

Allow visibility without constraints

parent 1aaa3139
No related branches found
No related tags found
No related merge requests found
...@@ -3810,6 +3810,10 @@ class VisibilityConstraint { ...@@ -3810,6 +3810,10 @@ class VisibilityConstraint {
} }
function emitJavascript($field) { function emitJavascript($field) {
if (!$this->constraint->constraints)
return;
$func = 'recheck'; $func = 'recheck';
$form = $field->getForm(); $form = $field->getForm();
?> ?>
...@@ -3851,6 +3855,12 @@ class VisibilityConstraint { ...@@ -3851,6 +3855,12 @@ class VisibilityConstraint {
* Determines if the field was visible when the form was submitted * Determines if the field was visible when the form was submitted
*/ */
function isVisible($field) { function isVisible($field) {
// Assume initial visibility if constraint is not provided.
if (!$this->constraint->constraints)
return $this->initial == self::VISIBLE;
return $this->compileQPhp($this->constraint, $field); return $this->compileQPhp($this->constraint, $field);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment