init tooltips after ajax in domains table

This commit is contained in:
Rachid Mrad 2025-01-08 17:45:24 -05:00
parent 8142daf3a6
commit 964550403d
No known key found for this signature in database
3 changed files with 13 additions and 1 deletions

View file

@ -4,7 +4,7 @@
* accessible directly in getgov.min.js
*
*/
export function initializeTooltips() {
export function uswdsInitializeTooltips() {
function checkTooltip() {
// Check that the tooltip library is loaded, and if not, wait and retry
if (window.tooltip && typeof window.tooltip.init === 'function') {

View file

@ -375,6 +375,13 @@ export class BaseTable {
*/
loadModals(page, total, unfiltered_total) {}
/**
* Loads tooltips + sets up event listeners
* "Activates" the tooltips after the DOM updates
* Utilizes "uswdsInitializeTooltips"
*/
initializeTooltips() {}
/**
* Allows us to customize the table display based on specific conditions and a user's permissions
* Dynamically manages the visibility set up of columns, adding/removing headers
@ -471,6 +478,7 @@ export class BaseTable {
this.initCheckboxListeners();
this.loadModals(data.page, data.total, data.unfiltered_total);
this.initializeTooltips();
// Do not scroll on first page load
if (scroll)

View file

@ -1,4 +1,5 @@
import { BaseTable } from './table-base.js';
import { uswdsInitializeTooltips } from './helpers-uswds.js';
export class DomainsTable extends BaseTable {
@ -66,6 +67,9 @@ export class DomainsTable extends BaseTable {
`;
tbody.appendChild(row);
}
initializeTooltips() {
uswdsInitializeTooltips();
}
}
export function initDomainsTable() {