Skip to content

Commit a902b89

Browse files
Vinicius Reisjuliusknorr
authored andcommitted
🩹 formatting-help must only be in extra options
Signed-off-by: Vinicius Reis <vinicius.reis@nextcloud.com>
1 parent d6fd404 commit a902b89

3 files changed

Lines changed: 50 additions & 14 deletions

File tree

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<!--
2+
- @copyright Copyright (c) 2022 Vinicius Reis <vinicius@nextcloud.com>
3+
-
4+
- @author Vinicius Reis <vinicius@nextcloud.com>
5+
-
6+
- @license GNU AGPL version 3 or any later version
7+
-
8+
- This program is free software: you can redistribute it and/or modify
9+
- it under the terms of the GNU Affero General Public License as
10+
- published by the Free Software Foundation, either version 3 of the
11+
- License, or (at your option) any later version.
12+
-
13+
- This program is distributed in the hope that it will be useful,
14+
- but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
- GNU Affero General Public License for more details.
17+
-
18+
- You should have received a copy of the GNU Affero General Public License
19+
- along with this program. If not, see <http://www.gnu.org/licenses/>.
20+
-
21+
-->
22+
<template>
23+
<NcActionButton close-after-click
24+
data-text-action-entry="formatting-help"
25+
v-on="$listeners">
26+
<template #icon>
27+
<Help />
28+
</template>
29+
{{ t('text', 'Formatting help') }}
30+
</NcActionButton>
31+
</template>
32+
33+
<script>
34+
import { defineComponent } from 'vue'
35+
import { NcActionButton } from '@nextcloud/vue'
36+
import { Help } from '../icons.js'
37+
38+
export default defineComponent({
39+
name: 'ActionFormattingHelp',
40+
components: {
41+
NcActionButton,
42+
Help,
43+
},
44+
})
45+
</script>

‎src/components/Menu/ActionList.vue‎

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,35 +41,24 @@
4141
:action-entry="child"
4242
v-on="$listeners"
4343
@trigged="onTrigger" />
44-
<NcActionButton close-after-click
45-
data-text-action-entry="formatting-help"
46-
@click="$emit('call:help')">
47-
<template #icon>
48-
<Help />
49-
</template>
50-
{{ t('text', 'Formatting help') }}
51-
</NcActionButton>
5244
<slot name="lastAction" />
5345
</NcActions>
5446
</template>
5547

5648
<script>
57-
import { NcActions, NcActionButton } from '@nextcloud/vue'
49+
import { NcActions } from '@nextcloud/vue'
5850
import { BaseActionEntry } from './BaseActionEntry.js'
5951
import ActionSingle from './ActionSingle.vue'
6052
import { getIsActive } from './utils.js'
6153
import { useOutlineStateMixin } from '../Editor/Wrapper.provider.js'
6254
import useStore from '../../mixins/store.js'
6355
import { useMenuIDMixin } from './MenuBar.provider.js'
64-
import { Help } from '../icons.js'
6556
6657
export default {
6758
name: 'ActionList',
6859
components: {
6960
NcActions,
70-
NcActionButton,
7161
ActionSingle,
72-
Help,
7362
},
7463
extends: BaseActionEntry,
7564
mixins: [useStore, useOutlineStateMixin, useMenuIDMixin],

‎src/components/Menu/MenuBar.vue‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@
4545
:key="`text-action--${actionEntry.key}`" />
4646
<ActionList key="text-action--remain"
4747
:action-entry="hiddenEntries"
48-
@update:open="refreshWordCount"
49-
@call:help="showHelp">
48+
@update:open="refreshWordCount">
5049
<template #lastAction>
50+
<ActionFormattingHelp @click="showHelp" />
5151
<NcActionSeparator />
5252
<NcActionText data-text-action-entry="character-count">
5353
<template #icon>
@@ -83,11 +83,13 @@ import {
8383
useIsRichEditorMixin,
8484
useIsRichWorkspaceMixin,
8585
} from '../Editor.provider.js'
86+
import ActionFormattingHelp from './ActionFormattingHelp.vue'
8687
8788
export default {
8889
name: 'MenuBar',
8990
components: {
9091
ActionEntry,
92+
ActionFormattingHelp,
9193
ActionList,
9294
AlphabeticalVariant,
9395
HelpModal,

0 commit comments

Comments
 (0)