]> BookStack Code Mirror - bookstack/commitdiff
Added back in image options context toolbar item
authorDan Brown <redacted>
Mon, 18 Jul 2022 12:37:50 +0000 (13:37 +0100)
committerDan Brown <redacted>
Mon, 18 Jul 2022 12:37:50 +0000 (13:37 +0100)
resources/js/wysiwyg/toolbars.js

index 13fe1cf8e41286497d78dd5c66526ddeb5e2d5f8..208b3c508dc8e2f8b2671ed1c8ad3b43199da685 100644 (file)
@@ -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
Morty Proxy This is a proxified and sanitized view of the page, visit original site.