Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
radix
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
radix
Commits
869d2f07
Commit
869d2f07
authored
3 years ago
by
James Candan
Committed by
Sohail Lajevardi
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3260136
by jcandan: Make nav default to dropdown links optional
parent
8679d77d
No related branches found
No related tags found
1 merge request
!27
Issue #3260136: Make nav default to dropdown links optional
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/components/nav/nav.twig
+13
-8
13 additions, 8 deletions
src/components/nav/nav.twig
with
13 additions
and
8 deletions
src/components/nav/nav.twig
+
13
−
8
View file @
869d2f07
...
@@ -7,6 +7,7 @@
...
@@ -7,6 +7,7 @@
* - alignment: left | right | center | vertical.
* - alignment: left | right | center | vertical.
* - style: tabs | pills
* - style: tabs | pills
* - fill: fill | justify
* - fill: fill | justify
* - is_dropdown: true | false
* - utility_classes: An array of utility classes.
* - utility_classes: An array of utility classes.
*/
*/
#}
#}
...
@@ -24,6 +25,7 @@
...
@@ -24,6 +25,7 @@
{%
set
style
=
style
?
'nav-'
~
style
:
''
%}
{%
set
style
=
style
?
'nav-'
~
style
:
''
%}
{%
set
fill
=
fill
?
'nav-'
~
fill
:
''
%}
{%
set
fill
=
fill
?
'nav-'
~
fill
:
''
%}
{%
set
is_dropdown
=
is_dropdown
is
null
?
true
%}
{%
set
nav_classes
=
[
'nav'
,
style
,
alignment
,
fill
]
|
merge
(
utility_classes
?
utility_classes
:
[])
%}
{%
set
nav_classes
=
[
'nav'
,
style
,
alignment
,
fill
]
|
merge
(
utility_classes
?
utility_classes
:
[])
%}
...
@@ -34,7 +36,7 @@
...
@@ -34,7 +36,7 @@
{%
set
nav_item_classes
=
[
{%
set
nav_item_classes
=
[
'nav-item'
,
'nav-item'
,
item.in_active_trail
?
'active'
,
item.in_active_trail
?
'active'
,
i
tem.is_expanded
and
item.bel
ow
?
'dropdown'
i
s_dropd
ow
n
?
'dropdown'
]
%}
]
%}
{%
set
nav_link_classes
=
[
'nav-link'
]
%}
{%
set
nav_link_classes
=
[
'nav-link'
]
%}
{%
if
item.url.options.attributes.class
is
iterable
%}
{%
if
item.url.options.attributes.class
is
iterable
%}
...
@@ -43,19 +45,22 @@
...
@@ -43,19 +45,22 @@
{%
set
nav_link_classes
=
nav_link_classes
|
merge
([
item.url.options.attributes.class
])
%}
{%
set
nav_link_classes
=
nav_link_classes
|
merge
([
item.url.options.attributes.class
])
%}
{%
endif
%}
{%
endif
%}
<li
{{
item.attributes.addClass
(
nav_item_classes
)
}}
>
<li
{{
item.attributes.addClass
(
nav_item_classes
)
}}
>
{%
if
item.is_expanded
and
item.below
%}
{%
if
item.is_expanded
and
item.below
and
is_dropdown
%}
{{
link
(
item.title
,
item.url
,
{
'class'
:
nav_link_classes
|
merge
([
'dropdown-toggle'
]),
'data-toggle'
:
'dropdown'
}
)
}}
{{
link
(
item.title
,
item.url
,
{
'class'
:
nav_link_classes
|
merge
([
'dropdown-toggle'
]),
'data-toggle'
:
'dropdown'
}
)
}}
{%
if
item.below
%}
{%
include
'@radix/dropdown/dropdown-menu.twig'
with
{
{%
include
'@radix/dropdown/dropdown-menu.twig'
with
{
items
:
item.below
items
:
item.below
}
%}
}
%}
{%
endif
%}
{%
else
%}
{%
else
%}
{{
link
(
item.title
,
item.url
,
{
'class'
:
nav_link_classes
}
)
}}
{{
link
(
item.title
,
item.url
,
{
'class'
:
nav_link_classes
}
)
}}
{%
if
item.is_expanded
and
item.below
and
not
is_dropdown
%}
{%
include
'@evo_radix/nav/nav.twig'
with
{
items
:
item.below
,
is_dropdown
:
false
,
}
%}
{%
endif
%}
{%
endif
%}
{%
endif
%}
</li>
</li>
{%
endfor
%}
{%
endfor
%}
{%
endblock
%}
{%
endblock
%}
</ul>
</ul>
{%
endif
%}
{%
endif
%}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment