From 070074456a5f96d8093a5d288700a6f96469d941 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maur=C3=ADcio=20Meneghini=20Fauth?= Date: Thu, 23 Jan 2025 17:07:36 -0300 Subject: [PATCH] Replace jQuery UI's tooltip for showHints() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: MaurĂ­cio Meneghini Fauth --- resources/js/src/modules/functions.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/resources/js/src/modules/functions.ts b/resources/js/src/modules/functions.ts index 45db0ddb4c..4a49b1c68b 100644 --- a/resources/js/src/modules/functions.ts +++ b/resources/js/src/modules/functions.ts @@ -2,7 +2,6 @@ import $ from 'jquery'; import { AJAX } from './ajax.ts'; import { Navigation } from './navigation.ts'; import { CommonParams } from './common.ts'; -import tooltip from './tooltip.ts'; import highlightSql from './sql-highlight.ts'; import { ajaxRemoveMessage, ajaxShowMessage } from './ajax-message.ts'; import { escapeHtml } from './functions/escape.ts'; @@ -2831,8 +2830,10 @@ export function showHints ($div: JQuery | undefined = undefined) { $newDiv = $('body'); } - $newDiv.find('.pma_hint').each(function () { - tooltip($(this).children('img'), 'img', $(this).children('span').html()); + $newDiv.get(0).querySelectorAll('.pma_hint').forEach((hintElement: HTMLElement): void => { + const content = hintElement.querySelector('span').textContent; + window.bootstrap.Tooltip.getOrCreateInstance(hintElement, { title: content }) + .setContent({ '.tooltip-inner': content }); }); }