|
11 | 11 | * Quill Toolbar helper class. |
12 | 12 | * |
13 | 13 | * @author Paweł Bizley Brzozowski |
14 | | - * @version 1.2.0 |
| 14 | + * @version 1.2.0.1 |
15 | 15 | * @license Apache 2.0 |
16 | 16 | * https://github.com/bizley/yii2-quill |
17 | 17 | * |
@@ -48,17 +48,20 @@ public function __construct($configuration, $componentConfig = []) |
48 | 48 | if (!is_string($configuration) && !is_array($configuration)) { |
49 | 49 | throw new InvalidConfigException('Toolbar configuration must be a string or an array!'); |
50 | 50 | } |
51 | | - } |
52 | | - if (is_string($configuration)) { |
53 | | - switch ($configuration) { |
54 | | - case Quill::TOOLBAR_FULL: |
55 | | - $this->prepareFullToolbar(); |
56 | | - break; |
57 | | - case Quill::TOOLBAR_BASIC: |
58 | | - $this->prepareBasicToolbar(); |
59 | | - break; |
60 | | - default: |
61 | | - $this->_elements = (array)$configuration; |
| 51 | + if (is_string($configuration)) { |
| 52 | + switch ($configuration) { |
| 53 | + case Quill::TOOLBAR_FULL: |
| 54 | + $this->prepareFullToolbar(); |
| 55 | + break; |
| 56 | + case Quill::TOOLBAR_BASIC: |
| 57 | + $this->prepareBasicToolbar(); |
| 58 | + break; |
| 59 | + default: |
| 60 | + $this->_elements = (array)$configuration; |
| 61 | + } |
| 62 | + } |
| 63 | + if (is_array($configuration)) { |
| 64 | + $this->_elements = $configuration; |
62 | 65 | } |
63 | 66 | } |
64 | 67 | parent::__construct($componentConfig); |
@@ -209,7 +212,7 @@ public function renderAlignment() |
209 | 212 | */ |
210 | 213 | public function renderBackColor() |
211 | 214 | { |
212 | | - return $this->renderDropdown('rgb(0, 0, 0)', $this->getColors(), |
| 215 | + return $this->renderDropdown('rgb(0, 0, 0)', $this->colors, |
213 | 216 | [ |
214 | 217 | 'title' => Yii::t('app', 'Background Color'), |
215 | 218 | 'class' => 'ql-background' |
@@ -470,7 +473,7 @@ public function renderStrikethrough() |
470 | 473 | */ |
471 | 474 | public function renderTextColor() |
472 | 475 | { |
473 | | - return $this->renderDropdown('rgb(0, 0, 0)', $this->getColors(), |
| 476 | + return $this->renderDropdown('rgb(0, 0, 0)', $this->colors, |
474 | 477 | [ |
475 | 478 | 'title' => Yii::t('app', 'Text Color'), |
476 | 479 | 'class' => 'ql-color' |
|
0 commit comments