From f19e9bab9285e090888f0898b47d1d54d18360e0 Mon Sep 17 00:00:00 2001 From: Johannes Eder Date: Tue, 24 Aug 2021 14:38:26 +0200 Subject: [PATCH] chore(tooltips): all tooltips classes are removed in a loop --- frontend/src/utils/tooltips/tooltips.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/frontend/src/utils/tooltips/tooltips.js b/frontend/src/utils/tooltips/tooltips.js index 2a4d77e9b..1bd831c59 100644 --- a/frontend/src/utils/tooltips/tooltips.js +++ b/frontend/src/utils/tooltips/tooltips.js @@ -190,13 +190,12 @@ export class Tooltip { destroy() { this._eventManager.cleanUp(); - if(this._element.classList.contains(TOOLTIP_OPEN_CLASS)) - this._element.classList.remove(TOOLTIP_OPEN_CLASS); - if(this._element.classList.contains('tooltip--right')) - this._element.classList.remove('tooltip--right'); - if(this._element.classList.contains('tooltip--bottom')) - this._element.classList.remove('tooltip--bottom'); this._movementObserver.unobserve(); - this._element.classList.remove(TOOLTIP_INITIALIZED_CLASS); + for (let i = 0; i < this._element.classList.length; i++) { + if (/tooltip--*/.test(this._element.classList[i])) + this._element.classList.remove(this._element.classList.item(i)); + else + i++; + } } };