Skip to content

Commit

Permalink
Changed tab id's in bootstrap-tabs from just group-tabX to
Browse files Browse the repository at this point in the history
group-tabX_Y_Z (form id, rowid, tab id), to avoid conflicts when a
tabbed form pops up a tabbed form.
  • Loading branch information
cheesegrits committed Oct 16, 2015
1 parent 9eb2ccb commit f4afeff
Showing 1 changed file with 4 additions and 2 deletions.
Expand Up @@ -65,12 +65,13 @@
<?php
$i = 0;
foreach ($this->groups as $group) :
$tab_id = $this->form->id . '_' . (int)$this->rowid . '_' . $i;
// If this ismultipage then groups are consolidated until a group with a page break
// So we should only show a tab if: it is first tab, or if it is a page break
if (!$model->isMultiPage() || $i == 0 || $group->splitPage) :
?>
<li <?php if ($i == 0) echo 'class="active"'?> style="<?php echo $group->css;?>">
<a href="#group-tab<?php echo $i;?>" data-toggle="tab" id="group<?php echo $group->id;?>_tab">
<a href="#group-tab<?php echo $tab_id;?>" data-toggle="tab" id="group<?php echo $group->id;?>_tab">
<?php
if (!empty($group->title))
{
Expand All @@ -95,13 +96,14 @@
$i = 0;
foreach ($this->groups as $group) :
$this->group = $group;
$tab_id = $this->form->id . '_' . (int)$this->rowid . '_' . $i;
if ($i == 0 || !$model->isMultiPage() || $group->splitPage) :
if ($i != 0)
{
echo '</div>';
}
?>
<div class="tab-pane<?php if ($i == 0) echo " active"?>" id="group-tab<?php echo $i;?>">
<div class="tab-pane<?php if ($i == 0) echo " active"?>" id="group-tab<?php echo $tab_id;?>">
<?php
$i++;
endif; ?>
Expand Down

0 comments on commit f4afeff

Please sign in to comment.