From 1222cc3312352f763a206490742960933015eb9d Mon Sep 17 00:00:00 2001 From: Burak Civan Date: Fri, 9 Dec 2022 15:44:45 +0300 Subject: [PATCH] console error fixed --- public/akaunting-js/generalAction.js | 65 +++++++++++++++------------- 1 file changed, 34 insertions(+), 31 deletions(-) diff --git a/public/akaunting-js/generalAction.js b/public/akaunting-js/generalAction.js index cc7440e07..aac586901 100644 --- a/public/akaunting-js/generalAction.js +++ b/public/akaunting-js/generalAction.js @@ -252,42 +252,45 @@ function runTooltip(tooltipToggleEl) { } else { tooltipEl.classList.add("opacity-100", "visible"); } + + // Enable the event listeners + + popperInstance.setOptions((options) => ({ + ...options, + modifiers: [ + ...options.modifiers, + { + name: "eventListeners", + enabled: true, + }, + ], + })); // Update its position + + popperInstance.update(); } - // Enable the event listeners - - popperInstance.setOptions((options) => ({ - ...options, - modifiers: [ - ...options.modifiers, - { - name: "eventListeners", - enabled: true, - }, - ], - })); // Update its position - - popperInstance.update(); } function hide() { - // Hide the tooltip - if (tooltipEl.classList.contains("opacity-100", "visible")) { - tooltipEl.classList.remove("opacity-100", "visible"); - } else { - tooltipEl.classList.add("opacity-0", "invisible"); - } - // Disable the event listeners + if (tooltipEl !== null) { + // Hide the tooltip + if (tooltipEl.classList.contains("opacity-100", "visible")) { + tooltipEl.classList.remove("opacity-100", "visible"); + } else { + tooltipEl.classList.add("opacity-0", "invisible"); + } + // Disable the event listeners - popperInstance.setOptions((options) => ({ - ...options, - modifiers: [ - ...options.modifiers, - { - name: "eventListeners", - enabled: false, - }, - ], - })); + popperInstance.setOptions((options) => ({ + ...options, + modifiers: [ + ...options.modifiers, + { + name: "eventListeners", + enabled: false, + }, + ], + })); + } } var showEvents = [];