From 6a6f00058fd68a719be27552ae2a7d5b1667c16a Mon Sep 17 00:00:00 2001 From: Dan Brown Date: Mon, 18 Jul 2022 13:37:50 +0100 Subject: [PATCH] Added back in image options context toolbar item --- resources/js/wysiwyg/toolbars.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/resources/js/wysiwyg/toolbars.js b/resources/js/wysiwyg/toolbars.js index 13fe1cf8e..208b3c508 100644 --- a/resources/js/wysiwyg/toolbars.js +++ b/resources/js/wysiwyg/toolbars.js @@ -54,6 +54,20 @@ function registerLinkContextToolbar(editor) { }); } +/** + * @param {Editor} editor + */ +function registerImageContextToolbar(editor) { + editor.ui.registry.addContextToolbar('imagecontexttoolbar', { + predicate(node) { + return node.closest('img') !== null; + }, + position: 'node', + scope: 'node', + items: 'image' + }); +} + /** * @param {Editor} editor * @param {WysiwygConfigOptions} options @@ -61,4 +75,5 @@ function registerLinkContextToolbar(editor) { export function registerAdditionalToolbars(editor, options) { registerPrimaryToolbarGroups(editor); registerLinkContextToolbar(editor); + registerImageContextToolbar(editor); } \ No newline at end of file