Commit deb80c5a by Hikonobu Kurihara

Updated components.Bootstrap

YII_DEVでない場合、minifyされたファイルを読み込むようにした。2.1.0の実装を流用した。
parent 6e2475d7
...@@ -97,10 +97,13 @@ class Bootstrap extends CApplicationComponent ...@@ -97,10 +97,13 @@ class Bootstrap extends CApplicationComponent
/** /**
* Registers the Bootstrap CSS. * Registers the Bootstrap CSS.
*
* stolen from 2.1.0
*/ */
public function registerCoreCss() public function registerCoreCss()
{ {
Yii::app()->clientScript->registerCssFile($this->getAssetsUrl().'/css/bootstrap.css'); $filename = YII_DEBUG ? 'bootstrap.css' : 'bootstrap.min.css';
Yii::app()->clientScript->registerCssFile($this->getAssetsUrl().'/css/'.$filename);
} }
/** /**
...@@ -112,7 +115,8 @@ class Bootstrap extends CApplicationComponent ...@@ -112,7 +115,8 @@ class Bootstrap extends CApplicationComponent
/** @var CClientScript $cs */ /** @var CClientScript $cs */
$cs = Yii::app()->getClientScript(); $cs = Yii::app()->getClientScript();
$cs->registerMetaTag('width=device-width, initial-scale=1.0', 'viewport'); $cs->registerMetaTag('width=device-width, initial-scale=1.0', 'viewport');
$cs->registerCssFile($this->getAssetsUrl().'/css/bootstrap-responsive.css'); $filename = YII_DEBUG ? 'bootstrap-responsive.css' : 'bootstrap-responsive.min.css';
$cs->registerCssFile($this->getAssetsUrl().'/css/'.$filename);
} }
/** /**
...@@ -145,7 +149,8 @@ class Bootstrap extends CApplicationComponent ...@@ -145,7 +149,8 @@ class Bootstrap extends CApplicationComponent
/** @var CClientScript $cs */ /** @var CClientScript $cs */
$cs = Yii::app()->getClientScript(); $cs = Yii::app()->getClientScript();
$cs->registerCoreScript('jquery'); $cs->registerCoreScript('jquery');
$cs->registerScriptFile($this->getAssetsUrl().'/js/bootstrap.js', $position); $filename = YII_DEBUG ? 'bootstrap.js' : 'bootstrap.min.js';
$cs->registerScriptFile($this->getAssetsUrl().'/js/'.$filename, $position);
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment