Commit b1460fe5 by Alexander Kochetov

Bundle names fixes, base widget fixes, other widgets fixes

parent 0763684e
......@@ -77,6 +77,7 @@ class Alert extends Widget
{
parent::init();
$this->getView()->registerAssetBundle('yii/bootstrap/alert');
$this->initOptions();
echo Html::beginTag('div', $this->options) . "\n";
......
......@@ -102,6 +102,7 @@ class Modal extends Widget
{
parent::init();
$this->getView()->registerAssetBundle('yii/bootstrap/modal');
$this->initOptions();
echo $this->renderToggleButton() . "\n";
......
......@@ -68,6 +68,7 @@ class TypeAhead extends Widget
*/
public function run()
{
$this->getView()->registerAssetBundle('yii/bootstrap/typeahead');
echo $this->renderField();
$this->registerPlugin('typeahead');
}
......
......@@ -25,7 +25,10 @@ class Widget extends \yii\base\Widget
* @var boolean whether to use the responsive version of Bootstrap.
*/
public static $responsive = true;
/**
* @var boolean whether to use the transition effects.
*/
public static $transition = true;
/**
* @var array the HTML attributes for the widget container tag.
*/
......@@ -67,9 +70,11 @@ class Widget extends \yii\base\Widget
{
$id = $this->options['id'];
$view = $this->getView();
$view->registerAssetBundle(static::$responsive ? 'yii/bootstrap/responsive' : 'yii/bootstrap');
$bundle = static::$responsive ? 'yii/bootstrap-responsive' : 'yii/bootstrap';
$view->registerAssetBundle($bundle);
if (static::$transition) {
$view->registerAssetBundle('yii/bootstrap/transition');
}
if ($this->pluginOptions !== false) {
$options = empty($this->pluginOptions) ? '' : Json::encode($this->pluginOptions);
......
<?php
return array(
'yii/bootstrap/css' => array(
'yii/bootstrap' => array(
'sourcePath' => __DIR__ . '/assets',
'css' => array(
YII_DEBUG ? 'css/bootstrap.css' : 'css/bootstrap.min.css',
),
),
'yii/bootstrap/css-responsive' => array(
'yii/bootstrap/responsive' => array(
'sourcePath' => __DIR__ . '/assets',
'css' => array(
YII_DEBUG ? 'css/bootstrap-responsive.css' : 'css/bootstrap-responsive.min.css',
),
'depends' => array('yii/bootstrap/css'),
),
'yii/bootstrap/all' => array(
'sourcePath' => __DIR__ . '/assets',
'js' => array(
YII_DEBUG ? 'js/bootstrap.js' : 'js/bootstrap.min.js',
),
'depends' => array('yii/jquery', 'yii/bootstrap/css'),
'depends' => array('yii/bootstrap'),
),
'yii/bootstrap/affix' => array(
'sourcePath' => __DIR__ . '/assets',
'js' => array(
'js/bootstrap-affix.js',
),
'depends' => array('yii/jquery', 'yii/bootstrap/css'),
'depends' => array('yii/jquery', 'yii/bootstrap'),
),
'yii/bootstrap/alert' => array(
'sourcePath' => __DIR__ . '/assets',
'js' => array(
'js/bootstrap-alert.js',
),
'depends' => array('yii/jquery', 'yii/bootstrap/css'),
'depends' => array('yii/jquery', 'yii/bootstrap'),
),
'yii/bootstrap/button' => array(
'sourcePath' => __DIR__ . '/assets',
'js' => array(
'js/bootstrap-button.js',
),
'depends' => array('yii/jquery', 'yii/bootstrap/css'),
'depends' => array('yii/jquery', 'yii/bootstrap'),
),
'yii/bootstrap/carousel' => array(
'sourcePath' => __DIR__ . '/assets',
'js' => array(
'js/bootstrap-carousel.js',
),
'depends' => array('yii/jquery', 'yii/bootstrap/css'),
'depends' => array('yii/jquery', 'yii/bootstrap'),
),
'yii/bootstrap/collapse' => array(
'sourcePath' => __DIR__ . '/assets',
'js' => array(
'js/bootstrap-collapse.js',
),
'depends' => array('yii/jquery', 'yii/bootstrap/css'),
'depends' => array('yii/jquery', 'yii/bootstrap'),
),
'yii/bootstrap/dropdown' => array(
'sourcePath' => __DIR__ . '/assets',
'js' => array(
'js/bootstrap-dropdown.js',
),
'depends' => array('yii/jquery', 'yii/bootstrap/css'),
'depends' => array('yii/jquery', 'yii/bootstrap'),
),
'yii/bootstrap/modal' => array(
'sourcePath' => __DIR__ . '/assets',
'js' => array(
'js/bootstrap-modal.js',
),
'depends' => array('yii/jquery', 'yii/bootstrap/css'),
'depends' => array('yii/jquery', 'yii/bootstrap'),
),
'yii/bootstrap/popover' => array(
'sourcePath' => __DIR__ . '/assets',
'js' => array(
'js/bootstrap-popover.js',
),
'depends' => array('yii/jquery', 'yii/bootstrap/tooltip', 'yii/bootstrap/css'),
'depends' => array('yii/jquery', 'yii/bootstrap/tooltip', 'yii/bootstrap'),
),
'yii/bootstrap/scrollspy' => array(
'sourcePath' => __DIR__ . '/assets',
'js' => array(
'js/bootstrap-scrollspy.js',
),
'depends' => array('yii/jquery', 'yii/bootstrap/css'),
'depends' => array('yii/jquery', 'yii/bootstrap'),
),
'yii/bootstrap/tab' => array(
'sourcePath' => __DIR__ . '/assets',
'js' => array(
'js/bootstrap-tab.js',
),
'depends' => array('yii/jquery', 'yii/bootstrap/css'),
'depends' => array('yii/jquery', 'yii/bootstrap'),
),
'yii/bootstrap/tooltip' => array(
'sourcePath' => __DIR__ . '/assets',
'js' => array(
'js/bootstrap-tooltip.js',
),
'depends' => array('yii/jquery', 'yii/bootstrap/css'),
'depends' => array('yii/jquery', 'yii/bootstrap'),
),
'yii/bootstrap/transition' => array(
'sourcePath' => __DIR__ . '/assets',
'js' => array(
'js/bootstrap-transition.js',
),
'depends' => array('yii/jquery', 'yii/bootstrap/css'),
'depends' => array('yii/jquery', 'yii/bootstrap'),
),
'yii/bootstrap/typeahead' => array(
'sourcePath' => __DIR__ . '/assets',
'js' => array(
'js/bootstrap-typeahead.js',
),
'depends' => array('yii/jquery', 'yii/bootstrap/css'),
'depends' => array('yii/jquery', 'yii/bootstrap'),
),
);
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