Skip to content

Commit 876e5d0

Browse files
authored
Merge pull request #186 from jenkinsci/tooltip-on-redraw
Initialize BS tooltips every time the table renders
2 parents 3bc6425 + 19e4db4 commit 876e5d0

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/main/webapp/js/table.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,6 @@ jQuery3(document).ready(function () {
7575
(function () {
7676
const model = JSON.parse(t.responseObject());
7777
dataTable.rows.add(model).draw();
78-
jQuery3('[data-bs-toggle="tooltip"]').each(function () {
79-
const tooltip = new bootstrap5.Tooltip(jQuery3(this)[0]);
80-
tooltip.enable();
81-
});
8278
})();
8379
});
8480
}
@@ -114,6 +110,13 @@ jQuery3(document).ready(function () {
114110
}
115111
});
116112

113+
table.on('draw.dt', function () {
114+
table.find('[data-bs-toggle="tooltip"]').each(function () {
115+
const tooltip = new bootstrap5.Tooltip(jQuery3(this)[0]);
116+
tooltip.enable();
117+
});
118+
});
119+
117120
if (table.is(":visible")) {
118121
loadTableData(table, dataTable);
119122
}

0 commit comments

Comments
 (0)