Commit c79965ce by Qiang Xue

Renamed yii\jui\Widget::clientEventsMap to clientEventMap

parent 7d1c4637
...@@ -26,7 +26,7 @@ use yii\helpers\Html; ...@@ -26,7 +26,7 @@ use yii\helpers\Html;
*/ */
class Slider extends Widget class Slider extends Widget
{ {
protected $clientEventsMap = [ protected $clientEventMap = [
'change' => 'slidechange', 'change' => 'slidechange',
'create' => 'slidecreate', 'create' => 'slidecreate',
'slide' => 'slide', 'slide' => 'slide',
...@@ -42,4 +42,4 @@ class Slider extends Widget ...@@ -42,4 +42,4 @@ class Slider extends Widget
echo Html::tag('div', '', $this->options); echo Html::tag('div', '', $this->options);
$this->registerWidget('slider', SliderAsset::className()); $this->registerWidget('slider', SliderAsset::className());
} }
} }
\ No newline at end of file
...@@ -43,7 +43,7 @@ use yii\helpers\Html; ...@@ -43,7 +43,7 @@ use yii\helpers\Html;
*/ */
class SliderInput extends InputWidget class SliderInput extends InputWidget
{ {
protected $clientEventsMap = [ protected $clientEventMap = [
'change' => 'slidechange', 'change' => 'slidechange',
'create' => 'slidecreate', 'create' => 'slidecreate',
'slide' => 'slide', 'slide' => 'slide',
...@@ -76,4 +76,4 @@ class SliderInput extends InputWidget ...@@ -76,4 +76,4 @@ class SliderInput extends InputWidget
$this->registerWidget('slider', SliderAsset::className()); $this->registerWidget('slider', SliderAsset::className());
$this->getView()->registerJs('$("#'.$inputId.'").val($("#'.$this->id.'").slider("value"));'); $this->getView()->registerJs('$("#'.$inputId.'").val($("#'.$this->id.'").slider("value"));');
} }
} }
\ No newline at end of file
...@@ -38,7 +38,7 @@ use yii\helpers\Html; ...@@ -38,7 +38,7 @@ use yii\helpers\Html;
*/ */
class Spinner extends InputWidget class Spinner extends InputWidget
{ {
protected $clientEventsMap = [ protected $clientEventMap = [
'spin' => 'spin', 'spin' => 'spin',
]; ];
......
...@@ -46,7 +46,7 @@ class Widget extends \yii\base\Widget ...@@ -46,7 +46,7 @@ class Widget extends \yii\base\Widget
* @var array event names mapped to what should be specified in .on( * @var array event names mapped to what should be specified in .on(
* If empty, it is assumed that event passed to clientEvents is prefixed with widget name. * If empty, it is assumed that event passed to clientEvents is prefixed with widget name.
*/ */
protected $clientEventsMap = []; protected $clientEventMap = [];
/** /**
* Initializes the widget. * Initializes the widget.
...@@ -97,8 +97,8 @@ class Widget extends \yii\base\Widget ...@@ -97,8 +97,8 @@ class Widget extends \yii\base\Widget
$id = $this->options['id']; $id = $this->options['id'];
$js = []; $js = [];
foreach ($this->clientEvents as $event => $handler) { foreach ($this->clientEvents as $event => $handler) {
if (isset($this->clientEventsMap[$event])) { if (isset($this->clientEventMap[$event])) {
$eventName = $this->clientEventsMap[$event]; $eventName = $this->clientEventMap[$event];
} else { } else {
$eventName = $name.$event; $eventName = $name.$event;
} }
......
...@@ -17,6 +17,7 @@ Yii Framework 2 Change Log ...@@ -17,6 +17,7 @@ Yii Framework 2 Change Log
- Enh: Added `favicon.ico` and `robots.txt` to defauly application templates (samdark) - Enh: Added `favicon.ico` and `robots.txt` to defauly application templates (samdark)
- Enh: Added `Widget::autoIdPrefix` to support prefixing automatically generated widget IDs (qiangxue) - Enh: Added `Widget::autoIdPrefix` to support prefixing automatically generated widget IDs (qiangxue)
- Enh: Support for file aliases in console command 'message' (omnilight) - Enh: Support for file aliases in console command 'message' (omnilight)
- Chg: Renamed yii\jui\Widget::clientEventsMap to clientEventMap (qiangxue)
- New #1438: [MongoDB integration](https://github.com/yiisoft/yii2-mongodb) ActiveRecord and Query (klimov-paul) - New #1438: [MongoDB integration](https://github.com/yiisoft/yii2-mongodb) ActiveRecord and Query (klimov-paul)
2.0.0 alpha, December 1, 2013 2.0.0 alpha, December 1, 2013
......
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