Skip to content

Commit

Permalink
Merge pull request #5226 from nextcloud/bugfix/5220
Browse files Browse the repository at this point in the history
fix: Prioritize un-collapsible menubar entries for mobile and aggregate children in the hidden entries
  • Loading branch information
juliushaertl committed Jan 10, 2024
2 parents 9ab649a + b38ea59 commit 4b548d9
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) => {
// If entry has children, merge them into list. Otherwise keep entry itself.
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 4b548d9

Please sign in to comment.