Skip to content

Commit

Permalink
Updates to release v2.1.6 fix #298 fix #289
Browse files Browse the repository at this point in the history
  • Loading branch information
kartik-v committed Nov 1, 2019
1 parent 91a9095 commit 6a1a5e4
Show file tree
Hide file tree
Showing 21 changed files with 30 additions and 23 deletions.
6 changes: 6 additions & 0 deletions CHANGE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Change Log: `yii2-widget-select2`
=================================

## Version 2.1.6

**Date:** 01-Nov-2019

- (enh #298, #289): Fix empty options when placeholder is set.

## Version 2.1.5

**Date:** 31-Oct-2019
Expand Down
7 changes: 4 additions & 3 deletions src/Select2.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @copyright Copyright © Kartik Visweswaran, Krajee.com, 2014 - 2019
* @package yii2-widgets
* @subpackage yii2-widget-select2
* @version 2.1.5
* @version 2.1.6
*/

namespace kartik\select2;
Expand Down Expand Up @@ -236,16 +236,17 @@ public function renderWidget()
if (empty($this->data)) {
$emptyValue = !isset($this->value) || $this->value === '';
$emptyInitText = !isset($this->initValueText) || $this->initValueText === '';
$emptyPH = !isset($this->pluginOptions['placeholder']);
if ($emptyValue && $emptyInitText) {
$this->data = ['' => ''];
$this->data = $emptyPH ? ['' => ''] : [];
} else {
if ($multiple) {
$key = !$emptyValue && is_array($this->value) ? $this->value : [];
} else {
$key = !$emptyValue ? $this->value : '';
}
$val = !$emptyInitText ? $this->initValueText : $key;
$this->data = $multiple ? array_combine((array)$key, (array)$val) : [$key => $val];
$this->data = $multiple ? array_combine((array)$key, (array)$val) : (($emptyPH && $key !== '') ? [$key => $val] : []);
}
}
$this->initLanguage('language', true);
Expand Down
2 changes: 1 addition & 1 deletion src/Select2Asset.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @copyright Copyright © Kartik Visweswaran, Krajee.com, 2014 - 2019
* @package yii2-widgets
* @subpackage yii2-widget-select2
* @version 2.1.5
* @version 2.1.6
*/

namespace kartik\select2;
Expand Down
2 changes: 1 addition & 1 deletion src/Select2KrajeeAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @copyright Copyright © Kartik Visweswaran, Krajee.com, 2014 - 2019
* @package yii2-widgets
* @subpackage yii2-widget-select2
* @version 2.1.5
* @version 2.1.6
*/

namespace kartik\select2;
Expand Down
2 changes: 1 addition & 1 deletion src/ThemeAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @copyright Copyright © Kartik Visweswaran, Krajee.com, 2014 - 2019
* @package yii2-widgets
* @subpackage yii2-widget-select2
* @version 2.1.5
* @version 2.1.6
*/

namespace kartik\select2;
Expand Down
2 changes: 1 addition & 1 deletion src/ThemeBootstrapAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @copyright Copyright © Kartik Visweswaran, Krajee.com, 2014 - 2019
* @package yii2-widgets
* @subpackage yii2-widget-select2
* @version 2.1.5
* @version 2.1.6
*/

namespace kartik\select2;
Expand Down
2 changes: 1 addition & 1 deletion src/ThemeClassicAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @copyright Copyright © Kartik Visweswaran, Krajee.com, 2014 - 2019
* @package yii2-widgets
* @subpackage yii2-widget-select2
* @version 2.1.5
* @version 2.1.6
*/

namespace kartik\select2;
Expand Down
2 changes: 1 addition & 1 deletion src/ThemeDefaultAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @copyright Copyright © Kartik Visweswaran, Krajee.com, 2014 - 2019
* @package yii2-widgets
* @subpackage yii2-widget-select2
* @version 2.1.5
* @version 2.1.6
*/

namespace kartik\select2;
Expand Down
2 changes: 1 addition & 1 deletion src/ThemeKrajeeAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @copyright Copyright © Kartik Visweswaran, Krajee.com, 2014 - 2019
* @package yii2-widgets
* @subpackage yii2-widget-select2
* @version 2.1.5
* @version 2.1.6
*/

namespace kartik\select2;
Expand Down
2 changes: 1 addition & 1 deletion src/ThemeKrajeeBs4Asset.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @copyright Copyright © Kartik Visweswaran, Krajee.com, 2014 - 2019
* @package yii2-widgets
* @subpackage yii2-widget-select2
* @version 2.1.5
* @version 2.1.6
*/

namespace kartik\select2;
Expand Down
4 changes: 2 additions & 2 deletions src/ThemeMaterialAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @copyright Copyright © Kartik Visweswaran, Krajee.com, 2014 - 2019
* @package yii2-widgets
* @subpackage yii2-widget-select2
* @version 2.1.5
* @version 2.1.6
*/

namespace kartik\select2;
Expand All @@ -14,7 +14,7 @@
*
* @author Mohamad Faeez <[email protected]>
* @modified Kartik Visweswaran <[email protected]>
* @since 2.1.5
* @since 2.1.6
*/
class ThemeMaterialAsset extends ThemeAsset
{
Expand Down
2 changes: 1 addition & 1 deletion src/assets/css/select2-addl.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2019
* @version 2.1.5
* @version 2.1.6
*
* Additional CSS for Select2 for extra functionalities added by Krajee
*
Expand Down
2 changes: 1 addition & 1 deletion src/assets/css/select2-addl.min.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2019
* @version 2.1.5
* @version 2.1.6
*
* Additional CSS for Select2 for extra functionalities added by Krajee
*
Expand Down
2 changes: 1 addition & 1 deletion src/assets/css/select2-krajee-bs4.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2019
* @version 2.1.5
* @version 2.1.6
*
* Krajee Bootstrap 4.x Theme for Select2
*
Expand Down
2 changes: 1 addition & 1 deletion src/assets/css/select2-krajee-bs4.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/assets/css/select2-krajee.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2019
* @version 2.1.5
* @version 2.1.6
*
* Krajee Bootstrap 3.x Theme for Select2
*
Expand Down
2 changes: 1 addition & 1 deletion src/assets/css/select2-krajee.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/assets/css/select2-material.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2019
* @version 2.1.5
* @version 2.1.6
*
* Material Theme for Select2
*
Expand Down
2 changes: 1 addition & 1 deletion src/assets/css/select2-material.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/assets/js/select2-krajee.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2019
* @version 2.1.5
* @version 2.1.6
*
* Additional enhancements for Select2 widget extension for Yii 2.0.
*
Expand Down
2 changes: 1 addition & 1 deletion src/assets/js/select2-krajee.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6a1a5e4

Please sign in to comment.