Browse Source

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

tags/2.0.1
Klimov Paul 10 years ago
parent
commit
1605905fc1
  1. 2
      extensions/authclient/CHANGELOG.md
  2. 4
      extensions/authclient/widgets/AuthChoice.php
  3. 6
      extensions/authclient/widgets/AuthChoiceAsset.php
  4. 24
      extensions/authclient/widgets/AuthChoiceStyleAsset.php

2
extensions/authclient/CHANGELOG.md

@ -4,7 +4,7 @@ Yii Framework 2 authclient extension Change Log
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

4
extensions/authclient/widgets/AuthChoice.php

@ -225,10 +225,12 @@ class AuthChoice extends Widget
*/
public function init()
{
$view = Yii::$app->getView();
if ($this->popupMode) {
$view = Yii::$app->getView();
AuthChoiceAsset::register($view);
$view->registerJs("\$('#" . $this->getId() . "').authchoice();");
} else {
AuthChoiceStyleAsset::register($view);
}
$this->options['id'] = $this->getId();
echo Html::beginTag('div', $this->options);

6
extensions/authclient/widgets/AuthChoiceAsset.php

@ -12,6 +12,8 @@ use yii\web\AssetBundle;
/**
* AuthChoiceAsset is an asset bundle for [[AuthChoice]] widget.
*
* @see AuthChoiceStyleAsset
*
* @author Paul Klimov <klimov.paul@gmail.com>
* @since 2.0
*/
@ -21,10 +23,8 @@ class AuthChoiceAsset extends AssetBundle
public $js = [
'authchoice.js',
];
public $css = [
'authchoice.css',
];
public $depends = [
'yii\authclient\widgets\AuthChoiceStyleAsset',
'yii\web\YiiAsset',
];
}

24
extensions/authclient/widgets/AuthChoiceStyleAsset.php

@ -0,0 +1,24 @@
<?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',
];
}
Loading…
Cancel
Save