Skip to content

Commit

Permalink
fix: allow ActionButton for hidden breadcrumb
Browse files Browse the repository at this point in the history
Signed-off-by: Raimund Schlüßler <raimund.schluessler@mailbox.org>
  • Loading branch information
raimund-schluessler committed Aug 14, 2023
1 parent ebbb63f commit 2bcf4e0
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/components/NcBreadcrumbs/NcBreadcrumbs.vue
Expand Up @@ -138,6 +138,7 @@ export default {

<script>
import NcActions from '../NcActions/index.js'
import NcActionButton from '../NcActionButton/index.js'
import NcActionRouter from '../NcActionRouter/index.js'
import NcActionLink from '../NcActionLink/index.js'
import NcBreadcrumb from '../NcBreadcrumb/index.js'
Expand All @@ -157,6 +158,7 @@ export default {
name: 'NcBreadcrumbs',
components: {
NcActions,
NcActionButton,
NcActionRouter,
NcActionLink,
NcBreadcrumb,
Expand Down Expand Up @@ -593,9 +595,13 @@ export default {
const title = crumb.componentOptions.propsData.title
const name = crumb.componentOptions.propsData.name
// Decide whether to show the breadcrumbs as ActionRouter or ActionLink
let element = 'NcActionLink'
let path = href
// Decide whether to show the breadcrumbs as ActionButton, ActionRouter or ActionLink
let element = 'NcActionButton'
let path = ''
if (href) {
element = 'NcActionLink'
path = href
}
if (to) {
element = 'NcActionRouter'
path = to
Expand All @@ -609,9 +615,9 @@ export default {
return h(element, {
class: crumbClass,
props: {
href,
href: href ? href : null,

Check failure on line 618 in src/components/NcBreadcrumbs/NcBreadcrumbs.vue

View workflow job for this annotation

GitHub Actions / eslint

Unnecessary use of conditional expression for default assignment
title,
to,
to: to ? to : null,

Check failure on line 620 in src/components/NcBreadcrumbs/NcBreadcrumbs.vue

View workflow job for this annotation

GitHub Actions / eslint

Unnecessary use of conditional expression for default assignment
},
// Prevent the breadcrumbs from being draggable
attrs: {
Expand Down

0 comments on commit 2bcf4e0

Please sign in to comment.