Skip to content

Commit

Permalink
Merge pull request #1259 from carloslancha/issue-1250-ClayCreationMen…
Browse files Browse the repository at this point in the history
…uDropdownWithNoPrimaryItems

Fixes #1250 - Check also if secondaryItems is empty in creationMenu
  • Loading branch information
julien authored Oct 26, 2018
2 parents c5c192f + a1100ba commit 4393cb6
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -346,8 +346,10 @@
viewMoreURL: string
]}

{if $creationMenu and $creationMenu.primaryItems and length($creationMenu.primaryItems) == 1 and not $creationMenu.secondaryItems}
{let $item: $creationMenu.primaryItems[0] /}
{if $creationMenu and (($creationMenu.primaryItems and length($creationMenu.primaryItems) == 1 and (not $creationMenu.secondaryItems or length($creationMenu.secondaryItems) == 0)) or ($creationMenu.secondaryItems and length($creationMenu.secondaryItems) == 1 and (not $creationMenu.primaryItems or length($creationMenu.primaryItems) == 0)))}
{let $item: $creationMenu.primaryItems and $creationMenu.primaryItems[0] ?
$creationMenu.primaryItems[0] :
$creationMenu.secondaryItems[0].items ? $creationMenu.secondaryItems[0].items[0] : $creationMenu.secondaryItems[0] /}

{if $item.href}
{call ClayLink.render}
Expand Down

0 comments on commit 4393cb6

Please sign in to comment.