From 9eba85cc3e531dfe2182c3d64c28afdb6f5b9d0c Mon Sep 17 00:00:00 2001 From: Paidge <paidge_cs@hotmail.com> Date: Thu, 9 Jun 2022 11:25:04 +0200 Subject: [PATCH] hide tooltips on route change --- layouts/default.vue | 8 ++++++++ plugins/bootstrap.js | 1 - 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/layouts/default.vue b/layouts/default.vue index a6a7331..8ad8450 100644 --- a/layouts/default.vue +++ b/layouts/default.vue @@ -77,6 +77,14 @@ export default { this.$nuxt.$on("changeRoute", (breadcrumb) => { this.breadcrumb = breadcrumb }) + }, + watch: { + $route(to, from) { + let tooltips = document.querySelectorAll(".tooltip.show") + tooltips.forEach((tooltip) => { + tooltip.classList.remove("show") + }) + } } } </script> diff --git a/plugins/bootstrap.js b/plugins/bootstrap.js index 177cae8..eb028a5 100644 --- a/plugins/bootstrap.js +++ b/plugins/bootstrap.js @@ -29,7 +29,6 @@ Vue.directive("tooltip", function (el, binding, vnode) { vnode.context.$nextTick(() => { var x = new MutationObserver(function (e) { - console.log(e) if (e[0].removedNodes) tooltip.hide() }); -- GitLab