fixed mailto: links on home

This commit is contained in:
Bachir Soussi Chiadmi 2021-06-08 11:48:43 +02:00
parent 10083d75c5
commit 1bdacc98ff
4 changed files with 20 additions and 15 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -123,21 +123,26 @@ export default {
},
onClickLink(e){
console.log("onClickLink", e, this.$router, this.$route)
let path = null;
// find existing router route compared with link href
for (let i = 0; i < this.$router.options.routes.length; i++) {
if (this.$router.options.routes[i].path == e.originalTarget.pathname) {
if (e.originalTarget.pathname !== this.$route.path) {
path = e.originalTarget.pathname
if (e.originalTarget.protocol == "mailto:") {
// https://stackoverflow.com/questions/10172499/mailto-using-javascript
window.location.href = e.originalTarget.href
}else {
let path = null;
// find existing router route compared with link href
for (let i = 0; i < this.$router.options.routes.length; i++) {
if (this.$router.options.routes[i].path == e.originalTarget.pathname) {
if (e.originalTarget.pathname !== this.$route.path) {
path = e.originalTarget.pathname
}
break
}
break
}
}
if (path) {
this.$router.push({
path: path
})
if (path) {
this.$router.push({
path: path
})
}
}
},
onClickFieldLabel(e){