Commit 1605905f by Klimov Paul

Fixed CCS for `yii\authclient\widgets\AuthChoice` does not loaded if `popupMode` disabled

parent 255cf947
...@@ -4,7 +4,7 @@ Yii Framework 2 authclient extension Change Log ...@@ -4,7 +4,7 @@ Yii Framework 2 authclient extension Change Log
2.0.1 under development 2.0.1 under development
----------------------- -----------------------
- no changes in this release. - Bug #6000: Fixed CCS for `yii\authclient\widgets\AuthChoice` does not loaded if `popupMode` disabled (klimov-paul)
2.0.0 October 12, 2014 2.0.0 October 12, 2014
......
...@@ -225,10 +225,12 @@ class AuthChoice extends Widget ...@@ -225,10 +225,12 @@ class AuthChoice extends Widget
*/ */
public function init() public function init()
{ {
if ($this->popupMode) {
$view = Yii::$app->getView(); $view = Yii::$app->getView();
if ($this->popupMode) {
AuthChoiceAsset::register($view); AuthChoiceAsset::register($view);
$view->registerJs("\$('#" . $this->getId() . "').authchoice();"); $view->registerJs("\$('#" . $this->getId() . "').authchoice();");
} else {
AuthChoiceStyleAsset::register($view);
} }
$this->options['id'] = $this->getId(); $this->options['id'] = $this->getId();
echo Html::beginTag('div', $this->options); echo Html::beginTag('div', $this->options);
......
...@@ -12,6 +12,8 @@ use yii\web\AssetBundle; ...@@ -12,6 +12,8 @@ use yii\web\AssetBundle;
/** /**
* AuthChoiceAsset is an asset bundle for [[AuthChoice]] widget. * AuthChoiceAsset is an asset bundle for [[AuthChoice]] widget.
* *
* @see AuthChoiceStyleAsset
*
* @author Paul Klimov <klimov.paul@gmail.com> * @author Paul Klimov <klimov.paul@gmail.com>
* @since 2.0 * @since 2.0
*/ */
...@@ -21,10 +23,8 @@ class AuthChoiceAsset extends AssetBundle ...@@ -21,10 +23,8 @@ class AuthChoiceAsset extends AssetBundle
public $js = [ public $js = [
'authchoice.js', 'authchoice.js',
]; ];
public $css = [
'authchoice.css',
];
public $depends = [ public $depends = [
'yii\authclient\widgets\AuthChoiceStyleAsset',
'yii\web\YiiAsset', 'yii\web\YiiAsset',
]; ];
} }
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
namespace yii\authclient\widgets;
use yii\web\AssetBundle;
/**
* AuthChoiceAsset is an asset bundle for [[AuthChoice]] widget.
*
* @author Paul Klimov <klimov.paul@gmail.com>
* @since 2.0
*/
class AuthChoiceStyleAsset extends AssetBundle
{
public $sourcePath = '@yii/authclient/assets';
public $css = [
'authchoice.css',
];
}
\ No newline at end of file
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