Skip to content

Commit 8355689

Browse files
author
igor-chepurnoi
committed
remove assets folder, add bower dependency
1 parent 06ab79c commit 8355689

File tree

5 files changed

+46
-4095
lines changed

5 files changed

+46
-4095
lines changed

Selectize.php

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,29 +32,23 @@ class Selectize extends InputWidget
3232
public $pluginOptions = [];
3333

3434
/**
35-
* Initializes the object.
36-
*/
37-
public function init()
38-
{
39-
parent::init();
40-
}
41-
42-
/**
43-
* Render selectize widget
44-
* @return string|void
35+
* @inheritdoc
4536
*/
4637
public function run()
4738
{
48-
if (is_null($this->items)) {
39+
if (empty($this->items)) {
4940
$this->renderInput();
5041
} else {
5142
$this->renderDropDown();
5243
}
44+
5345
$this->registerAssets();
5446
}
5547

5648
/**
5749
* Register client assets
50+
*
51+
* @return void
5852
*/
5953
protected function registerAssets()
6054
{
@@ -65,7 +59,8 @@ protected function registerAssets()
6559
}
6660

6761
/**
68-
* Return plugin options in json format
62+
* Get plugin options in the json format
63+
*
6964
* @return string
7065
*/
7166
public function getPluginOptions()
@@ -80,11 +75,14 @@ function (query, callback) {
8075
}
8176
");
8277
}
78+
8379
return Json::encode($this->pluginOptions);
8480
}
8581

8682
/**
8783
* Return input id
84+
*
85+
* @return string
8886
*/
8987
public function getInputId()
9088
{

SelectizeAsset.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,29 +11,29 @@
1111
class SelectizeAsset extends AssetBundle
1212
{
1313
/**
14-
* @var string
14+
* @var string the directory that contains the source asset files for this asset bundle.
1515
*/
16-
public $sourcePath = '@vendor/yii2mod/yii2-selectize/assets';
16+
public $sourcePath = '@bower/selectize.js/dist';
1717

1818
/**
19-
* @var array
19+
* @var array list of CSS files that this bundle contains.
2020
*/
2121
public $css = [
2222
'css/selectize.default.css'
2323
];
2424

2525
/**
26-
* @var array
26+
* @var array list of JavaScript files that this bundle contains.
2727
*/
2828
public $js = [
29-
'js/selectize.js',
29+
'js/standalone/selectize.js',
3030
];
3131

3232
/**
33-
* @var array
33+
* @var array list of bundle class names that this bundle depends on.
3434
*/
3535
public $depends = [
3636
'yii\web\YiiAsset',
3737
'yii\jui\JuiAsset'
3838
];
39-
}
39+
}

0 commit comments

Comments
 (0)