Skip to content
Snippets Groups Projects
Commit 9eba85cc authored by Pierre-Jean CHANCELLIER's avatar Pierre-Jean CHANCELLIER
Browse files

hide tooltips on route change

parent b6f91b6c
No related branches found
No related tags found
No related merge requests found
...@@ -77,6 +77,14 @@ export default { ...@@ -77,6 +77,14 @@ export default {
this.$nuxt.$on("changeRoute", (breadcrumb) => { this.$nuxt.$on("changeRoute", (breadcrumb) => {
this.breadcrumb = breadcrumb this.breadcrumb = breadcrumb
}) })
},
watch: {
$route(to, from) {
let tooltips = document.querySelectorAll(".tooltip.show")
tooltips.forEach((tooltip) => {
tooltip.classList.remove("show")
})
}
} }
} }
</script> </script>
......
...@@ -29,7 +29,6 @@ Vue.directive("tooltip", function (el, binding, vnode) { ...@@ -29,7 +29,6 @@ Vue.directive("tooltip", function (el, binding, vnode) {
vnode.context.$nextTick(() => { vnode.context.$nextTick(() => {
var x = new MutationObserver(function (e) { var x = new MutationObserver(function (e) {
console.log(e)
if (e[0].removedNodes) tooltip.hide() if (e[0].removedNodes) tooltip.hide()
}); });
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment