Commit c71b5f5d authored by Elias Villiger's avatar Elias Villiger
Browse files

Merge branch '4837-dont-display-hidden-pills' into 'master'

4837 dont display hidden pills

See merge request !79
parents 90705891 870cd188
Pipeline #875 passed with stage
in 1 minute and 42 seconds
...@@ -438,7 +438,7 @@ class BuildFormBootstrap extends AbstractBuildForm { ...@@ -438,7 +438,7 @@ class BuildFormBootstrap extends AbstractBuildForm {
// Iterate over all 'pill' // Iterate over all 'pill'
$ii = 0; $ii = 0;
$active = 'class="active"'; $isFirstPill = true;
$recordId = $this->store->getVar(COLUMN_ID, STORE_RECORD . STORE_ZERO); $recordId = $this->store->getVar(COLUMN_ID, STORE_RECORD . STORE_ZERO);
foreach ($pillArray as $formElement) { foreach ($pillArray as $formElement) {
...@@ -493,7 +493,6 @@ class BuildFormBootstrap extends AbstractBuildForm { ...@@ -493,7 +493,6 @@ class BuildFormBootstrap extends AbstractBuildForm {
// $attributeLi = Support::doAttribute('style', 'display: none'); // $attributeLi = Support::doAttribute('style', 'display: none');
$attributeLi = Support::doAttribute('class', 'hidden'); $attributeLi = Support::doAttribute('class', 'hidden');
$json[$htmlFormElementName][API_ELEMENT_UPDATE][$htmlIdLi][API_ELEMENT_ATTRIBUTE][HTML_ATTR_CLASS] = 'hidden'; $json[$htmlFormElementName][API_ELEMENT_UPDATE][$htmlIdLi][API_ELEMENT_ATTRIBUTE][HTML_ATTR_CLASS] = 'hidden';
$a = '';
break; break;
default: default:
...@@ -506,13 +505,16 @@ class BuildFormBootstrap extends AbstractBuildForm { ...@@ -506,13 +505,16 @@ class BuildFormBootstrap extends AbstractBuildForm {
$a = Support::wrapTag("<a $attributeLiA" . Support::doAttribute('href', $hrefTarget) . ">", $formElement[FE_LABEL]); $a = Support::wrapTag("<a $attributeLiA" . Support::doAttribute('href', $hrefTarget) . ">", $formElement[FE_LABEL]);
$json[$htmlFormElementName][API_ELEMENT_UPDATE][$htmlIdLiA][API_ELEMENT_CONTENT] = $formElement[FE_LABEL]; $json[$htmlFormElementName][API_ELEMENT_UPDATE][$htmlIdLiA][API_ELEMENT_CONTENT] = $formElement[FE_LABEL];
if ($isFirstPill && $formElement[FE_MODE] != FE_MODE_HIDDEN) {
$attributeLi .= 'class="active" ';
$isFirstPill = false;
}
if ($ii <= $maxVisiblePill) { if ($ii <= $maxVisiblePill) {
$pillButton .= '<li role="presentation"' . $attributeLi . $active . ">" . $a . "</li>"; $pillButton .= '<li role="presentation"' . $attributeLi . ">" . $a . "</li>";
} else { } else {
$pillDropdown .= '<li ' . $attributeLi . '>' . $a . "</li>"; $pillDropdown .= '<li ' . $attributeLi . '>' . $a . "</li>";
} }
$active = '';
} }
// Pill Dropdown necessary? // Pill Dropdown necessary?
...@@ -789,11 +791,15 @@ EOF; ...@@ -789,11 +791,15 @@ EOF;
$html .= Support::wrapTag('<div class="col-md-12 qfq-form-body ' . $this->formSpec[F_CLASS_BODY] . '">', $elementHtml); $html .= Support::wrapTag('<div class="col-md-12 qfq-form-body ' . $this->formSpec[F_CLASS_BODY] . '">', $elementHtml);
$active = $this->isFirstPill ? ' active' : ''; if ($formElement[FE_MODE] == FE_MODE_HIDDEN) {
$class = ' hidden';
} else {
$class = $this->isFirstPill ? 'active ' : '';
$this->isFirstPill = false;
}
$html = Support::wrapTag('<div role="tabpanel" class="tab-pane' . $active . '" id="' . $this->createAnker($formElement['id']) . '">', $html); $html = Support::wrapTag('<div role="tabpanel" class="tab-pane ' . $class . '" id="' . $this->createAnker($formElement['id']) . '">', $html);
$this->isFirstPill = false;
return $html; return $html;
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment