From: Dan Brown Date: Mon, 18 Jul 2022 12:37:50 +0000 (+0100) Subject: Added back in image options context toolbar item X-Git-Tag: v22.07~1^2~21^2~4 X-Git-Url: http://source.bookstackapp.com/bookstack/commitdiff_plain/6a6f00058fd68a719be27552ae2a7d5b1667c16a Added back in image options context toolbar item --- 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