stable

Clone or download

Read-only

feat: Disable toolbar when user clicks outside editor or toolbar

Part of story #38627: Choice of a new Rich Text Editor The toolbar should be disabled by default and activated only when the user is in the editor. There are two particular cases in which the toolbar should not be disabled: - When the user is in an editor and clicks on the toolbar - When the user is in an editor and clicks on a toolbar popover: image or link (since popovers are in body) How to test: -> By default the toolbar should be disabled -- Click on an editor -> The toolbar should be enabled -- Click on the toolbar (bold) -> The toolbar should still be enabled -- Click on a toolbar popover (link) and click in the form -> The toolbar should still be enabled --> Click outside (table of contents) -> The toolbar should be disabled -> None of the toolbar items should be activated Change-Id: Idd00cff1593585a086624ae87bb35c9e528df6c2

Modified Files

Name
M lib/frontend/prose-mirror-editor-toolbar/src/elements/buttons/bold.test.ts +21 −17 Go to diff View file
M lib/frontend/prose-mirror-editor-toolbar/src/elements/buttons/bold.ts +5 −4 Go to diff View file
M lib/frontend/prose-mirror-editor-toolbar/src/elements/buttons/bullet-list.test.ts +21 −17 Go to diff View file
M lib/frontend/prose-mirror-editor-toolbar/src/elements/buttons/bullet-list.ts +3 −5 Go to diff View file
M lib/frontend/prose-mirror-editor-toolbar/src/elements/buttons/code.test.ts +21 −17 Go to diff View file
M lib/frontend/prose-mirror-editor-toolbar/src/elements/buttons/code.ts +5 −4 Go to diff View file
M lib/frontend/prose-mirror-editor-toolbar/src/elements/buttons/image/image-button-template.test.ts +14 −11 Go to diff View file
M lib/frontend/prose-mirror-editor-toolbar/src/elements/buttons/image/image-button-template.ts +1 −1 Go to diff View file
M lib/frontend/prose-mirror-editor-toolbar/src/elements/buttons/image/image-popover-template.ts +1 −1 Go to diff View file
M lib/frontend/prose-mirror-editor-toolbar/src/elements/buttons/image/image.ts +3 −3 Go to diff View file
M lib/frontend/prose-mirror-editor-toolbar/src/elements/buttons/italic.test.ts +4 −3 Go to diff View file
M lib/frontend/prose-mirror-editor-toolbar/src/elements/buttons/italic.ts +5 −4 Go to diff View file
M lib/frontend/prose-mirror-editor-toolbar/src/elements/buttons/link/link-button-template.test.ts +14 −11 Go to diff View file
M lib/frontend/prose-mirror-editor-toolbar/src/elements/buttons/link/link-button-template.ts +1 −1 Go to diff View file
M lib/frontend/prose-mirror-editor-toolbar/src/elements/buttons/link/link-popover-template.ts +1 −1 Go to diff View file
M lib/frontend/prose-mirror-editor-toolbar/src/elements/buttons/link/link.ts +3 −3 Go to diff View file
M lib/frontend/prose-mirror-editor-toolbar/src/elements/buttons/ordered-list.test.ts +21 −17 Go to diff View file
M lib/frontend/prose-mirror-editor-toolbar/src/elements/buttons/ordered-list.ts +3 −5 Go to diff View file
M lib/frontend/prose-mirror-editor-toolbar/src/elements/buttons/quote.test.ts +21 −17 Go to diff View file
M lib/frontend/prose-mirror-editor-toolbar/src/elements/buttons/quote.ts +5 −4 Go to diff View file
M lib/frontend/prose-mirror-editor-toolbar/src/elements/buttons/subscript.test.ts +21 −17 Go to diff View file
M lib/frontend/prose-mirror-editor-toolbar/src/elements/buttons/subscript.ts +5 −4 Go to diff View file
M lib/frontend/prose-mirror-editor-toolbar/src/elements/buttons/superscript.test.ts +23 −17 Go to diff View file
M lib/frontend/prose-mirror-editor-toolbar/src/elements/buttons/superscript.ts +5 −4 Go to diff View file
M lib/frontend/prose-mirror-editor-toolbar/src/elements/buttons/text-style/styles-option-template.ts +4 −3 Go to diff View file
M lib/frontend/prose-mirror-editor-toolbar/src/elements/buttons/text-style/text-style.ts +6 −1 Go to diff View file
M lib/frontend/prose-mirror-editor-toolbar/src/elements/buttons/unlink.test.ts +22 −18 Go to diff View file
M lib/frontend/prose-mirror-editor-toolbar/src/elements/buttons/unlink.ts +5 −5 Go to diff View file
M lib/frontend/prose-mirror-editor-toolbar/src/elements/toolbar-element.ts +23 −0 Go to diff View file
M lib/frontend/prose-mirror-editor-toolbar/src/helpers/class-getter.test.ts +16 −10 Go to diff View file
M lib/frontend/prose-mirror-editor-toolbar/src/helpers/class-getter.ts +8 −3 Go to diff View file
M lib/frontend/prose-mirror-editor/src/plugins/toolbar/helper/toolbar-bus.ts +11 −0 Go to diff View file
M plugins/artidoc/scripts/artidoc/src/components/toolbar/EditorToolbar.vue +2 −0 Go to diff View file
A plugins/artidoc/scripts/artidoc/src/helpers/toolbar-activator.test.ts +105 −0 Go to diff View file
A plugins/artidoc/scripts/artidoc/src/helpers/toolbar-activator.ts +60 −0 Go to diff View file