Merge branch 'main' into ag/3234-test-existing-script

This commit is contained in:
zandercymatics 2025-01-13 11:02:43 -07:00
commit 6a495192c6
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7
3 changed files with 13 additions and 1 deletions

View file

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

View file

@ -375,6 +375,13 @@ export class BaseTable {
*/ */
loadModals(page, total, unfiltered_total) {} 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 * 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 * Dynamically manages the visibility set up of columns, adding/removing headers
@ -471,6 +478,7 @@ export class BaseTable {
this.initCheckboxListeners(); this.initCheckboxListeners();
this.loadModals(data.page, data.total, data.unfiltered_total); this.loadModals(data.page, data.total, data.unfiltered_total);
this.initializeTooltips();
// Do not scroll on first page load // Do not scroll on first page load
if (scroll) if (scroll)

View file

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