Browse Source

NavBar updated to reflect bootstrap v3 changes. Logo is now visible when viewed via mobile.

tags/2.0.0-beta
Alexander Makarov 12 years ago
parent
commit
b70fceb605
  1. 11
      framework/yii/bootstrap/NavBar.php

11
framework/yii/bootstrap/NavBar.php

@ -65,16 +65,21 @@ class NavBar extends Widget
$this->clientOptions = false; $this->clientOptions = false;
Html::addCssClass($this->options, 'navbar'); Html::addCssClass($this->options, 'navbar');
Html::addCssClass($this->brandOptions, 'navbar-brand'); Html::addCssClass($this->brandOptions, 'navbar-brand');
if (empty($this->options['role'])) {
$this->options['role'] = 'navigation';
}
echo Html::beginTag('div', $this->options); echo Html::beginTag('nav', $this->options);
if ($this->responsive) { if ($this->responsive) {
echo Html::beginTag('div', array('class' => 'container')); echo Html::beginTag('div', array('class' => 'container'));
echo $this->renderToggleButton(); echo $this->renderToggleButton();
echo Html::beginTag('div', array('class' => 'nav-collapse collapse navbar-responsive-collapse'));
} }
if ($this->brandLabel !== null) { if ($this->brandLabel !== null) {
echo Html::a($this->brandLabel, $this->brandUrl, $this->brandOptions); echo Html::a($this->brandLabel, $this->brandUrl, $this->brandOptions);
} }
if ($this->responsive) {
echo Html::beginTag('div', array('class' => 'nav-collapse collapse navbar-responsive-collapse'));
}
} }
/** /**
@ -86,7 +91,7 @@ class NavBar extends Widget
echo Html::endTag('div'); echo Html::endTag('div');
echo Html::endTag('div'); echo Html::endTag('div');
} }
echo Html::endTag('div'); echo Html::endTag('nav');
BootstrapPluginAsset::register($this->getView()); BootstrapPluginAsset::register($this->getView());
} }

Loading…
Cancel
Save