diff --git a/src/Field.php b/src/Field.php index 24ba398e..28cf028b 100644 --- a/src/Field.php +++ b/src/Field.php @@ -368,6 +368,7 @@ protected function inputHtml(mixed $value, ElementInterface $element = null): st $event = new ModifyConfigEvent([ 'baseConfig' => $baseConfig, 'ckeConfig' => $ckeConfig, + 'toolbar' => $toolbar, ]); $this->trigger(self::EVENT_MODIFY_CONFIG, $event); @@ -389,7 +390,7 @@ protected function inputHtml(mixed $value, ElementInterface $element = null): st } $baseConfigJs = Json::encode($event->baseConfig); - $toolbarJs = Json::encode($toolbar); + $toolbarJs = Json::encode($event->toolbar); $languageJs = Json::encode([ 'ui' => BaseCkeditorPackageAsset::uiLanguage(), 'content' => $element?->getSite()->language ?? Craft::$app->language, diff --git a/src/events/ModifyConfigEvent.php b/src/events/ModifyConfigEvent.php index 017ba3b5..7aac744c 100644 --- a/src/events/ModifyConfigEvent.php +++ b/src/events/ModifyConfigEvent.php @@ -27,4 +27,9 @@ class ModifyConfigEvent extends Event * @var CkeConfig $ckeConfig The CKEditor config */ public CkeConfig $ckeConfig; + + /** + * @var array $toolbar The toolbar config + */ + public array $toolbar; }