From 5743d482d873f0144bba03390bfa6146c6a516de Mon Sep 17 00:00:00 2001
From: Alexander Kochetov <creocoder@gmail.com>
Date: Wed, 22 May 2013 17:37:41 +0400
Subject: [PATCH] A little yii\bootstrap classes refactoring

---
 framework/yii/bootstrap/Alert.php     | 1 -
 framework/yii/bootstrap/Modal.php     | 1 -
 framework/yii/bootstrap/TypeAhead.php | 1 -
 framework/yii/bootstrap/Widget.php    | 1 +
 4 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/framework/yii/bootstrap/Alert.php b/framework/yii/bootstrap/Alert.php
index 558865a..f84a70b 100644
--- a/framework/yii/bootstrap/Alert.php
+++ b/framework/yii/bootstrap/Alert.php
@@ -77,7 +77,6 @@ class Alert extends Widget
 	{
 		parent::init();
 
-		$this->getView()->registerAssetBundle('yii/bootstrap/alert');
 		$this->initOptions();
 
 		echo Html::beginTag('div', $this->options) . "\n";
diff --git a/framework/yii/bootstrap/Modal.php b/framework/yii/bootstrap/Modal.php
index 63c3450..1a70209 100644
--- a/framework/yii/bootstrap/Modal.php
+++ b/framework/yii/bootstrap/Modal.php
@@ -102,7 +102,6 @@ class Modal extends Widget
 	{
 		parent::init();
 
-		$this->getView()->registerAssetBundle('yii/bootstrap/modal');
 		$this->initOptions();
 
 		echo $this->renderToggleButton() . "\n";
diff --git a/framework/yii/bootstrap/TypeAhead.php b/framework/yii/bootstrap/TypeAhead.php
index 2064224..4aee46a 100644
--- a/framework/yii/bootstrap/TypeAhead.php
+++ b/framework/yii/bootstrap/TypeAhead.php
@@ -68,7 +68,6 @@ class TypeAhead extends Widget
 	 */
 	public function run()
 	{
-		$this->getView()->registerAssetBundle('yii/bootstrap/typeahead');
 		echo $this->renderField();
 		$this->registerPlugin('typeahead');
 	}
diff --git a/framework/yii/bootstrap/Widget.php b/framework/yii/bootstrap/Widget.php
index 2243bae..c607485 100644
--- a/framework/yii/bootstrap/Widget.php
+++ b/framework/yii/bootstrap/Widget.php
@@ -67,6 +67,7 @@ class Widget extends \yii\base\Widget
 		$id = $this->options['id'];
 		$view = $this->getView();
 		$view->registerAssetBundle(static::$responsive ? 'yii/bootstrap/responsive' : 'yii/bootstrap');
+		$view->registerAssetBundle("yii/bootstrap/$name");
 
 		if ($this->pluginOptions !== false) {
 			$options = empty($this->pluginOptions) ? '' : Json::encode($this->pluginOptions);
--
libgit2 0.27.1