Skip to content

Commit

Permalink
fix: Prioritize un-collapsible menubar entries for mobile and aggrega…
Browse files Browse the repository at this point in the history
…te children in the hidden entries

Signed-off-by: Julius Härtl <[email protected]>
  • Loading branch information
juliusknorr committed Jan 10, 2024
1 parent c7bd53f commit 49b70a5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
14 changes: 10 additions & 4 deletions src/components/Menu/MenuBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -161,14 +161,20 @@ export default {
return list
},
hiddenEntries() {
const entries = this.entries.filter(({ priority }) => {
// reverse logic from visibleEntries
return priority !== undefined && priority > this.iconsLimit
}).reduce((acc, entry) => {
// merge all entries children into the entries list
const children = entry.children ?? [entry]
return [...acc, ...children]
}, [])
return {
key: 'remain',
label: this.t('text', 'Remaining actions'),
icon: DotsHorizontal,
children: this.entries.filter(({ priority }) => {
// reverse logic from visibleEntries
return priority !== undefined && priority > this.iconsLimit
}),
children: entries,
}
},
},
Expand Down
6 changes: 3 additions & 3 deletions src/components/Menu/entries.js
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ export default [
},
},
],
priority: 3,
priority: 6,
},
{
key: 'code-block',
Expand Down Expand Up @@ -340,13 +340,13 @@ export default [
action: (command, emojiObject = {}) => {
return command.emoji(emojiObject)
},
priority: 5,
priority: 3,
},
{
key: 'insert-attachment',
label: t('text', 'Insert attachment'),
icon: Images,
component: ActionAttachmentUpload,
priority: 4,
priority: 1,
},
]

0 comments on commit 49b70a5

Please sign in to comment.