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 @@ ...@@ -4,22 +4,37 @@
<div v-for="link in group" :key="key + link.label + link.address"> <div v-for="link in group" :key="key + link.label + link.address">
<template v-if="!('visible' in link) || link.visible()"> <template v-if="!('visible' in link) || link.visible()">
<div v-if="!$store.state.show_sidebar_left && !fullwidth" class="link-button-wrapper"> <div v-if="!$store.state.show_sidebar_left && !fullwidth" class="link-button-wrapper">
<button class="link-button" :id="'sidenavbar-link-button-' + key + link.label" <router-link :to="link.address" v-if="!link.address.startsWith('https:/')">
:class="{'active': link.has_sub_pages? $route.path.startsWith(link.address):$route.path === link.address}" <button class="link-button" :id="'sidenavbar-link-button-' + key + link.label"
@click.stop="navigate(link.address)"> :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> <span class="sidebar-icon"><font-awesome-icon :icon="link.icon"/></span>
</button> </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" <b-popover :target="'sidenavbar-link-button-' + key + link.label" class="popover-wide" triggers="hover"
placement="right" container="sideNavbar" placement="right" container="sideNavbar"
:content="link.label" boundary="window" custom-class="popover-wide"/> :content="link.label" boundary="window" custom-class="popover-wide"/>
</div> </div>
<div v-if="$store.state.show_sidebar_left || fullwidth" class="link-button-wrapper"> <div v-if="$store.state.show_sidebar_left || fullwidth" class="link-button-wrapper">
<button class="link-button" <router-link :to="link.address" v-if="!link.address.startsWith('https:/')">
:class="{'active': link.has_sub_pages? $route.path.startsWith(link.address):$route.path === link.address}" <button class="link-button"
@click.stop="navigate(link.address)"> :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> <span class="sidebar-icon"><font-awesome-icon :icon="link.icon"/></span>
{{ link.label }} {{ link.label }}
</button> </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> </div>
</template> </template>
</div> </div>
...@@ -130,15 +145,6 @@ export default { ...@@ -130,15 +145,6 @@ export default {
}, },
fullwidth: true 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> </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