diff --git a/CHANGELOG.md b/CHANGELOG.md index c083a0a..c724ab7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ Yii Framework 2 bootstrap extension Change Log - Enh #43: Added support for the static form controls via `yii\bootstrap\Html` (klimov-paul) - Enh #44: Fixed `yii\bootstrap\ButtonDropdown` renders two buttons with the same id, if 'split' is enabled (klimov-paul) - Enh #50: Added `dropDownOptions` that is passed to `yii\bootstrap\Nav` dropdown items (fbau123) +- Enh #92: Allow overriding `data-toggle` in `yii\bootstrap\Tabs` (machour) 2.0.4 May 10, 2015 diff --git a/Tabs.php b/Tabs.php index f60724f..c6bc35f 100644 --- a/Tabs.php +++ b/Tabs.php @@ -169,7 +169,9 @@ class Tabs extends Widget } Html::addCssClass($linkOptions, ['widget' => 'dropdown-toggle']); - $linkOptions['data-toggle'] = 'dropdown'; + if (!isset($linkOptions['data-toggle'])) { + $linkOptions['data-toggle'] = 'dropdown'; + } $header = Html::a($label, "#", $linkOptions) . "\n" . Dropdown::widget(['items' => $item['items'], 'clientOptions' => false, 'view' => $this->getView()]); } else { @@ -185,7 +187,9 @@ class Tabs extends Widget if (isset($item['url'])) { $header = Html::a($label, $item['url'], $linkOptions); } else { - $linkOptions['data-toggle'] = 'tab'; + if (!isset($linkOptions['data-toggle'])) { + $linkOptions['data-toggle'] = 'tab'; + } $header = Html::a($label, '#' . $options['id'], $linkOptions); } @@ -250,8 +254,9 @@ class Tabs extends Widget $options['id'] = ArrayHelper::getValue($options, 'id', $this->options['id'] . '-dd' . $itemNumber . '-tab' . $n); $item['url'] = '#' . $options['id']; - $item['linkOptions']['data-toggle'] = 'tab'; - + if (!isset($item['linkOptions']['data-toggle'])) { + $item['linkOptions']['data-toggle'] = 'tab'; + } $panes[] = Html::tag('div', $content, $options); unset($item);