Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
1 merge request!794837 dont display hidden pills
Pipeline #875 passed
......@@ -438,7 +438,7 @@ class BuildFormBootstrap extends AbstractBuildForm {
// Iterate over all 'pill'
$ii = 0;
$active = 'class="active"';
$isFirstPill = true;
$recordId = $this->store->getVar(COLUMN_ID, STORE_RECORD . STORE_ZERO);
foreach ($pillArray as $formElement) {
......@@ -493,7 +493,6 @@ class BuildFormBootstrap extends AbstractBuildForm {
// $attributeLi = Support::doAttribute('style', 'display: none');
$attributeLi = Support::doAttribute('class', 'hidden');
$json[$htmlFormElementName][API_ELEMENT_UPDATE][$htmlIdLi][API_ELEMENT_ATTRIBUTE][HTML_ATTR_CLASS] = 'hidden';
$a = '';
break;
default:
......@@ -506,13 +505,16 @@ class BuildFormBootstrap extends AbstractBuildForm {
$a = Support::wrapTag("<a $attributeLiA" . Support::doAttribute('href', $hrefTarget) . ">", $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) {
$pillButton .= '<li role="presentation"' . $attributeLi . $active . ">" . $a . "</li>";
$pillButton .= '<li role="presentation"' . $attributeLi . ">" . $a . "</li>";
} else {
$pillDropdown .= '<li ' . $attributeLi . '>' . $a . "</li>";
}
$active = '';
}
// Pill Dropdown necessary?
......@@ -789,11 +791,15 @@ EOF;
$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;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment