Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
🩹 formatting-help must only be in extra options
Signed-off-by: Vinicius Reis <[email protected]>
  • Loading branch information
Vinicius Reis authored and juliusknorr committed Oct 14, 2022
commit a902b89e0f0e65b9158172a8bb73755d053304dc
45 changes: 45 additions & 0 deletions src/components/Menu/ActionFormattingHelp.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<!--
- @copyright Copyright (c) 2022 Vinicius Reis <[email protected]>
-
- @author Vinicius Reis <[email protected]>
-
- @license GNU AGPL version 3 or any later version
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as
- published by the Free Software Foundation, either version 3 of the
- License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-->
<template>
<NcActionButton close-after-click
data-text-action-entry="formatting-help"
v-on="$listeners">
<template #icon>
<Help />
</template>
{{ t('text', 'Formatting help') }}
</NcActionButton>
</template>

<script>
import { defineComponent } from 'vue'
import { NcActionButton } from '@nextcloud/vue'
import { Help } from '../icons.js'

export default defineComponent({
name: 'ActionFormattingHelp',
components: {
NcActionButton,
Help,
},
})
</script>
13 changes: 1 addition & 12 deletions src/components/Menu/ActionList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,35 +41,24 @@
:action-entry="child"
v-on="$listeners"
@trigged="onTrigger" />
<NcActionButton close-after-click
data-text-action-entry="formatting-help"
@click="$emit('call:help')">
<template #icon>
<Help />
</template>
{{ t('text', 'Formatting help') }}
</NcActionButton>
<slot name="lastAction" />
</NcActions>
</template>

<script>
import { NcActions, NcActionButton } from '@nextcloud/vue'
import { NcActions } from '@nextcloud/vue'
import { BaseActionEntry } from './BaseActionEntry.js'
import ActionSingle from './ActionSingle.vue'
import { getIsActive } from './utils.js'
import { useOutlineStateMixin } from '../Editor/Wrapper.provider.js'
import useStore from '../../mixins/store.js'
import { useMenuIDMixin } from './MenuBar.provider.js'
import { Help } from '../icons.js'

export default {
name: 'ActionList',
components: {
NcActions,
NcActionButton,
ActionSingle,
Help,
},
extends: BaseActionEntry,
mixins: [useStore, useOutlineStateMixin, useMenuIDMixin],
Expand Down
6 changes: 4 additions & 2 deletions src/components/Menu/MenuBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@
:key="`text-action--${actionEntry.key}`" />
<ActionList key="text-action--remain"
:action-entry="hiddenEntries"
@update:open="refreshWordCount"
@call:help="showHelp">
@update:open="refreshWordCount">
<template #lastAction>
<ActionFormattingHelp @click="showHelp" />
<NcActionSeparator />
<NcActionText data-text-action-entry="character-count">
<template #icon>
Expand Down Expand Up @@ -83,11 +83,13 @@ import {
useIsRichEditorMixin,
useIsRichWorkspaceMixin,
} from '../Editor.provider.js'
import ActionFormattingHelp from './ActionFormattingHelp.vue'

export default {
name: 'MenuBar',
components: {
ActionEntry,
ActionFormattingHelp,
ActionList,
AlphabeticalVariant,
HelpModal,
Expand Down