From a7e6f470f7390ef49f4b22ed20945a1d3329c245 Mon Sep 17 00:00:00 2001 From: DebaucheryLibrarian Date: Sun, 27 Dec 2020 04:21:10 +0100 Subject: [PATCH] Improved tooltip behavior and styling. --- assets/components/container/container.vue | 22 ++++ assets/components/filters/tag-filter.vue | 8 +- assets/components/header/header.vue | 18 ++- assets/components/tooltip/tooltip.vue | 138 ++++++++++++++++++++-- assets/js/main.js | 8 ++ package-lock.json | 5 + package.json | 1 + 7 files changed, 181 insertions(+), 19 deletions(-) diff --git a/assets/components/container/container.vue b/assets/components/container/container.vue index 60d49022..45ea7076 100644 --- a/assets/components/container/container.vue +++ b/assets/components/container/container.vue @@ -38,6 +38,24 @@ async function setConsent(consent) { } } +function blur(event) { + this.events.emit('blur', event); +} + +function resize(event) { + this.events.emit('resize', event); +} + +function mounted() { + document.addEventListener('click', this.blur); + window.addEventListener('resize', this.resize); +} + +function beforeUnmount() { + document.removeEventListener('click', this.blur); + window.removeEventListener('resize', this.resize); +} + export default { components: { Header, @@ -50,9 +68,13 @@ export default { showWarning: localStorage.getItem('consent') !== window.env.sessionId, }; }, + mounted, + beforeUnmount, methods: { toggleSidebar, setConsent, + blur, + resize, }, }; diff --git a/assets/components/filters/tag-filter.vue b/assets/components/filters/tag-filter.vue index 83d8401f..c6334093 100644 --- a/assets/components/filters/tag-filter.vue +++ b/assets/components/filters/tag-filter.vue @@ -15,7 +15,7 @@