Commit dd4bb018 authored by gj4210's avatar gj4210 👽
Browse files

FIX: Navigation links are proper links

parent 88604a18
Pipeline #189192 passed with stages
in 7 minutes and 55 seconds
......@@ -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>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment