From 5fa2d6d3a8adcad7a9ec20af1ea8d09bdee996c2 Mon Sep 17 00:00:00 2001 From: Alex-Code Date: Mon, 16 Dec 2013 16:08:25 +0000 Subject: [PATCH] Allow multiple navbars Changed the navbar target to be based of the widget id and not static. --- extensions/yii/bootstrap/NavBar.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/yii/bootstrap/NavBar.php b/extensions/yii/bootstrap/NavBar.php index 620f51e..4517bc5 100644 --- a/extensions/yii/bootstrap/NavBar.php +++ b/extensions/yii/bootstrap/NavBar.php @@ -76,7 +76,7 @@ class NavBar extends Widget } echo Html::endTag('div'); - echo Html::beginTag('div', ['class' => 'collapse navbar-collapse navbar-ex1-collapse']); + echo Html::beginTag('div', ['class' => "collapse navbar-collapse navbar-{$this->options['id']}-collapse"]); } /** @@ -102,7 +102,7 @@ class NavBar extends Widget return Html::button("{$screenReader}\n{$bar}\n{$bar}\n{$bar}", [ 'class' => 'navbar-toggle', 'data-toggle' => 'collapse', - 'data-target' => '.navbar-ex1-collapse', + 'data-target' => ".navbar-{$this->options['id']}-collapse", ]); } }