diff options
author | Vinicius Reis <vinicius.reis@nextcloud.com> | 2022-05-27 01:59:10 +0300 |
---|---|---|
committer | Vinicius Reis <vinicius.reis@nextcloud.com> | 2022-05-27 01:59:10 +0300 |
commit | bb05046d391d6d68f5beda906e0b175be6052ee8 (patch) | |
tree | a2a8bde3b9502f3aa42eb79bac6de1f3e4f1dfc6 /src/components/Menu | |
parent | ebb5ccda61c83b9fac2fbbe1d9c9a36fc5848493 (diff) |
🐛 (#2345): fix missing help modal
Signed-off-by: Vinicius Reis <vinicius.reis@nextcloud.com>
Diffstat (limited to 'src/components/Menu')
-rw-r--r-- | src/components/Menu/MenuBar.vue | 20 | ||||
-rw-r--r-- | src/components/Menu/entries.js | 2 |
2 files changed, 17 insertions, 5 deletions
diff --git a/src/components/Menu/MenuBar.vue b/src/components/Menu/MenuBar.vue index 92e96adc5..e2b660361 100644 --- a/src/components/Menu/MenuBar.vue +++ b/src/components/Menu/MenuBar.vue @@ -30,10 +30,13 @@ 'text-menubar--autohide': autohide, 'text-menubar--is-workspace': $isRichWorkspace }"> + <HelpModal v-if="displayHelp" @close="hideHelp" /> + <div v-if="$isRichEditor" ref="menubar" class="text-menubar__entries"> <ActionEntry v-for="actionEntry of visibleEntries" v-bind="{ actionEntry }" - :key="`text-action--${actionEntry.key}`" /> + :key="`text-action--${actionEntry.key}`" + @call:help="showHelp" /> </div> <div class="text-menubar__slot"> <slot /> @@ -43,7 +46,9 @@ <script> import { subscribe, unsubscribe } from '@nextcloud/event-bus' +import debounce from 'debounce' +import HelpModal from '../HelpModal.vue' import actionsFullEntries from './entries.js' import ActionEntry from './ActionEntry.js' import { DotsHorizontal } from '../icons.js' @@ -52,11 +57,10 @@ import { useIsRichEditorMixin, useIsRichWorkspaceMixin, } from '../EditorWrapper.provider.js' -import debounce from 'debounce' export default { name: 'MenuBar', - components: { ActionEntry }, + components: { ActionEntry, HelpModal }, mixins: [ useEditorMixin, useIsRichEditorMixin, @@ -70,8 +74,9 @@ export default { }, data() { return { - isReady: false, + displayHelp: false, forceRecompute: 0, + isReady: false, isVisible: this.$editor.isFocused, windowWidth: 0, } @@ -193,6 +198,13 @@ export default { this.forceRecompute++ }) }, + showHelp() { + this.displayHelp = true + }, + + hideHelp() { + this.displayHelp = false + }, }, } </script> diff --git a/src/components/Menu/entries.js b/src/components/Menu/entries.js index efbc5efcd..40f4ccce2 100644 --- a/src/components/Menu/entries.js +++ b/src/components/Menu/entries.js @@ -314,7 +314,7 @@ export default [ key: 'formatting-help', label: t('text', 'Formatting help'), icon: Help, - click: (view) => view.$emit('show-help'), + click: (view) => view.$emit('call:help'), priority: 17, }, ] |