diff --git a/CHANGELOG.md b/CHANGELOG.md index 681cdea4..064a97a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # CHANGELOG +## 11.2.0 + +- Added `delay` to wysiwyg editor field + ## 11.1.0 - Added `enableOpacity` to color picker field diff --git a/composer.json b/composer.json index 7d65d5d8..b45f5784 100644 --- a/composer.json +++ b/composer.json @@ -32,7 +32,7 @@ }, "extra": { "branch-alias": { - "dev-master": "11.1-dev" + "dev-master": "11.2-dev" } }, "autoload": { diff --git a/src/Fields/WysiwygEditor.php b/src/Fields/WysiwygEditor.php index cc4070a4..61b903a6 100644 --- a/src/Fields/WysiwygEditor.php +++ b/src/Fields/WysiwygEditor.php @@ -30,6 +30,14 @@ class WysiwygEditor extends Field protected $type = 'wysiwyg'; + /** @return static */ + public function delay(): self + { + $this->config->set('delay', true); + + return $this; + } + /** @return static */ public function mediaUpload(bool $mediaUpload): self { @@ -61,12 +69,4 @@ public function toolbar(string $toolbar): self return $this; } - - /** @return static */ - public function delay(): self - { - $this->config->set('delay', true); - - return $this; - } } diff --git a/tests/Fields/WysiwygEditorTest.php b/tests/Fields/WysiwygEditorTest.php index 38beaebe..128dba49 100644 --- a/tests/Fields/WysiwygEditorTest.php +++ b/tests/Fields/WysiwygEditorTest.php @@ -25,6 +25,12 @@ public function testType() $this->assertSame('wysiwyg', $field['type']); } + public function testDelay() + { + $field = WysiwygEditor::make('Wysiwyg Editor Delay')->delay()->toArray(); + $this->assertTrue($field['delay']); + } + public function testMediaUpload() { $field = WysiwygEditor::make('Wysiwyg Editor Media Upload')->mediaUpload(false)->toArray(); @@ -47,10 +53,4 @@ public function testToolbar() $field = WysiwygEditor::make('Wysiwyg Editor Toolbar')->toolbar('basic')->toArray(); $this->assertSame('basic', $field['toolbar']); } - - public function testDelay() - { - $field = WysiwygEditor::make('Wysiwyg Editor Delay')->delay()->toArray(); - $this->assertSame(true, $field['delay']); - } }