Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
scc-net
netvs
netvs-core
Commits
dd4bb018
Commit
dd4bb018
authored
Jan 19, 2022
by
gj4210
👽
Browse files
FIX: Navigation links are proper links
parent
88604a18
Pipeline
#189192
passed with stages
in 7 minutes and 55 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
frontend/src/components/Navigation.vue
View file @
dd4bb018
...
...
@@ -4,22 +4,37 @@
<div
v-for=
"link in group"
:key=
"key + link.label + link.address"
>
<template
v-if=
"!('visible' in link) || link.visible()"
>
<div
v-if=
"!$store.state.show_sidebar_left && !fullwidth"
class=
"link-button-wrapper"
>
<button
class=
"link-button"
:id=
"'sidenavbar-link-button-' + key + link.label"
:class=
"
{'active': link.has_sub_pages? $route.path.startsWith(link.address):$route.path === link.address}"
@click.stop="navigate(link.address)">
<span
class=
"sidebar-icon"
><font-awesome-icon
:icon=
"link.icon"
/></span>
</button>
<router-link
:to=
"link.address"
v-if=
"!link.address.startsWith('https:/')"
>
<button
class=
"link-button"
:id=
"'sidenavbar-link-button-' + key + link.label"
:class=
"
{'active': link.has_sub_pages? $route.path.startsWith(link.address):$route.path === link.address}">
<span
class=
"sidebar-icon"
><font-awesome-icon
:icon=
"link.icon"
/></span>
</button>
</router-link>
<a
:href=
"link.address"
target=
"_blank"
v-else
>
<button
class=
"link-button"
:id=
"'sidenavbar-link-button-' + key + link.label"
:class=
"
{'active': link.has_sub_pages? $route.path.startsWith(link.address):$route.path === link.address}">
<span
class=
"sidebar-icon"
><font-awesome-icon
:icon=
"link.icon"
/></span>
</button>
</a>
<b-popover
:target=
"'sidenavbar-link-button-' + key + link.label"
class=
"popover-wide"
triggers=
"hover"
placement=
"right"
container=
"sideNavbar"
:content=
"link.label"
boundary=
"window"
custom-class=
"popover-wide"
/>
</div>
<div
v-if=
"$store.state.show_sidebar_left || fullwidth"
class=
"link-button-wrapper"
>
<button
class=
"link-button"
:class=
"
{'active': link.has_sub_pages? $route.path.startsWith(link.address):$route.path === link.address}"
@click.stop="navigate(link.address)">
<span
class=
"sidebar-icon"
><font-awesome-icon
:icon=
"link.icon"
/></span>
{{
link
.
label
}}
</button>
<router-link
:to=
"link.address"
v-if=
"!link.address.startsWith('https:/')"
>
<button
class=
"link-button"
:class=
"
{'active': link.has_sub_pages? $route.path.startsWith(link.address):$route.path === link.address}">
<span
class=
"sidebar-icon"
><font-awesome-icon
:icon=
"link.icon"
/></span>
{{
link
.
label
}}
</button>
</router-link>
<a
:href=
"link.address"
target=
"_blank"
v-else
>
<button
class=
"link-button"
:class=
"
{'active': link.has_sub_pages? $route.path.startsWith(link.address):$route.path === link.address}">
<span
class=
"sidebar-icon"
><font-awesome-icon
:icon=
"link.icon"
/></span>
{{
link
.
label
}}
</button>
</a>
</div>
</
template
>
</div>
...
...
@@ -130,15 +145,6 @@ export default {
},
fullwidth
:
true
}
},
methods
:
{
navigate
(
to
)
{
if
(
to
.
startsWith
(
'
https://
'
))
{
window
.
open
(
to
,
'
_blank
'
).
focus
()
return
}
if
(
this
.
$route
.
path
!==
to
)
this
.
$router
.
push
(
to
)
}
}
}
</
script
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment