Browse Source

`Nav::renderItem()` adjusted

tags/2.0.6
Klimov Paul 9 years ago
parent
commit
1603a2b028
  1. 1
      CHANGELOG.md
  2. 8
      Nav.php

1
CHANGELOG.md

@ -4,6 +4,7 @@ Yii Framework 2 bootstrap extension Change Log
2.0.6 under development 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 #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) - 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) - Enh #45: Added support for Bootstrap checkbox/radio toggle buttons (RomeroMsk, klimov-paul)

8
Nav.php

@ -177,7 +177,9 @@ class Nav extends Widget
$active = $this->isItemActive($item); $active = $this->isItemActive($item);
} }
if (!empty($items)) { if (empty($items)) {
$items = '';
} else {
$linkOptions['data-toggle'] = 'dropdown'; $linkOptions['data-toggle'] = 'dropdown';
Html::addCssClass($options, ['widget' => 'dropdown']); Html::addCssClass($options, ['widget' => 'dropdown']);
Html::addCssClass($linkOptions, ['widget' => 'dropdown-toggle']); Html::addCssClass($linkOptions, ['widget' => 'dropdown-toggle']);
@ -192,10 +194,6 @@ class Nav extends Widget
} }
} }
if (empty($items)) {
$items = '';
}
if ($this->activateItems && $active) { if ($this->activateItems && $active) {
Html::addCssClass($options, 'active'); Html::addCssClass($options, 'active');
} }

Loading…
Cancel
Save