From d6866256dfa1cee14786c77865a482e3c9f45d19 Mon Sep 17 00:00:00 2001 From: Carsten Brandt Date: Tue, 17 Dec 2013 10:42:21 +0100 Subject: [PATCH] only add navbar-default when no other class is set (e.g. navbar-inverse) fixes #1553 --- extensions/yii/bootstrap/CHANGELOG.md | 1 + extensions/yii/bootstrap/NavBar.php | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/extensions/yii/bootstrap/CHANGELOG.md b/extensions/yii/bootstrap/CHANGELOG.md index 3dcc1f9..94b3d60 100644 --- a/extensions/yii/bootstrap/CHANGELOG.md +++ b/extensions/yii/bootstrap/CHANGELOG.md @@ -5,6 +5,7 @@ Yii Framework 2 bootstrap extension Change Log ---------------------------- - Enh #1474: Added option to make NavBar 100% width (cebe) +- Enh #1553: Only add navbar-default class to NavBar when no other class is specified (cebe) 2.0.0 alpha, December 1, 2013 ----------------------------- diff --git a/extensions/yii/bootstrap/NavBar.php b/extensions/yii/bootstrap/NavBar.php index af76970..4a15481 100644 --- a/extensions/yii/bootstrap/NavBar.php +++ b/extensions/yii/bootstrap/NavBar.php @@ -67,7 +67,10 @@ class NavBar extends Widget { parent::init(); $this->clientOptions = false; - Html::addCssClass($this->options, 'navbar navbar-default'); + Html::addCssClass($this->options, 'navbar'); + if ($this->options['class'] == 'navbar') { + Html::addCssClass($this->options, 'navbar-default'); + } Html::addCssClass($this->brandOptions, 'navbar-brand'); if (empty($this->options['role'])) { $this->options['role'] = 'navigation';