Commit 6bb9978d authored by Elias Villiger's avatar Elias Villiger
Browse files

Bug #4837 - Prevent showing first pill(s) if set to hidden

parent a8a05937
......@@ -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?
......@@ -782,11 +784,13 @@ 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) {
$active = $this->isFirstPill ? ' active' : '';
$this->isFirstPill = false;
}
$html = Support::wrapTag('<div role="tabpanel" class="tab-pane' . $active . '" id="' . $this->createAnker($formElement['id']) . '">', $html);
$this->isFirstPill = false;
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