Replace jQuery UI's tooltip for showHints()

Signed-off-by: Maurício Meneghini Fauth <mauricio@mfauth.net>
This commit is contained in:
Maurício Meneghini Fauth 2025-01-23 17:07:36 -03:00
parent bc6edc910d
commit 070074456a
No known key found for this signature in database
GPG Key ID: 6A16FD38AFC89CC8

View File

@ -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<HTMLElement> | 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 });
});
}