diff --git a/CHANGELOG.md b/CHANGELOG.md index 63dbe32..46ba447 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ Yii Framework 2 bootstrap extension Change Log 2.0.6 under development ----------------------- +- Bug #68: Fixed `yii\bootstrap\Nav` handling empty items (freezy-sk) - Bug #81: Fixed `yii\bootstrap\ActiveField::radioList()` and `yii\bootstrap\ActiveField::checkboxList()` ignore `itemOptions` (mikehaertl) - Bug #98: Fixed `yii\bootstrap\ButtonDropdown` setting `href` attribute for non `a` tags (13nightevil) - Enh #45: Added support for Bootstrap checkbox/radio toggle buttons (RomeroMsk, klimov-paul) diff --git a/Nav.php b/Nav.php index 3a93c31..bf755e4 100644 --- a/Nav.php +++ b/Nav.php @@ -177,7 +177,9 @@ class Nav extends Widget $active = $this->isItemActive($item); } - if (!empty($items)) { + if (empty($items)) { + $items = ''; + } else { $linkOptions['data-toggle'] = 'dropdown'; Html::addCssClass($options, ['widget' => 'dropdown']); Html::addCssClass($linkOptions, ['widget' => 'dropdown-toggle']); @@ -192,10 +194,6 @@ class Nav extends Widget } } - if (empty($items)) { - $items = ''; - } - if ($this->activateItems && $active) { Html::addCssClass($options, 'active'); }