diff --git a/core/src/main/resources/jenkins/management/AdministrativeMonitorsDecorator/footer.jelly b/core/src/main/resources/jenkins/management/AdministrativeMonitorsDecorator/footer.jelly
index 826b10461be6..1f1597bec8c3 100644
--- a/core/src/main/resources/jenkins/management/AdministrativeMonitorsDecorator/footer.jelly
+++ b/core/src/main/resources/jenkins/management/AdministrativeMonitorsDecorator/footer.jelly
@@ -39,7 +39,7 @@ THE SOFTWARE.
class="am-button"
href="#"
data-href="${rootURL}/administrativeMonitorsApi/nonSecurityPopupContent"
- title="${%tooltip(activeNonSecurityAMCount)}">
+ tooltip="${%tooltip(activeNonSecurityAMCount)}">
@@ -57,7 +57,7 @@ THE SOFTWARE.
class="am-button security-am"
href="#"
data-href="${rootURL}/administrativeMonitorsApi/securityPopupContent"
- title="${%tooltipSec(activeSecurityAMCount)}">
+ tooltip="${%tooltipSec(activeSecurityAMCount)}">
diff --git a/war/src/main/js/tooltips.js b/war/src/main/js/tooltips.js
index f8432ae1dde5..843f888774b1 100644
--- a/war/src/main/js/tooltips.js
+++ b/war/src/main/js/tooltips.js
@@ -1,5 +1,12 @@
import tippy from "tippy.js"
+const TOOLTIP_BASE = {
+ arrow: false,
+ theme: "tooltip",
+ animation: "tooltip",
+ appendTo: document.body
+}
+
registerTooltips()
/**
@@ -15,19 +22,13 @@ function registerTooltips() {
tippy("[tooltip]", {
content: element => element.getAttribute("tooltip"),
- arrow: false,
- theme: "tooltip",
- animation: "tooltip",
- appendTo: document.body,
+ ...TOOLTIP_BASE
})
tippy("[html-tooltip]", {
content: element => element.getAttribute("html-tooltip"),
allowHTML: true,
- arrow: false,
- theme: "tooltip",
- animation: "tooltip",
- appendTo: document.body,
+ ...TOOLTIP_BASE
})
}
@@ -40,12 +41,9 @@ function hoverNotification(text, element) {
const tooltip = tippy(element, {
interactive: true,
trigger: "hover",
- arrow: false,
- theme: "tooltip",
offset: [0, 0],
- animation: "tooltip",
content: text,
- appendTo: document.body,
+ ...TOOLTIP_BASE,
onShow(instance) {
setTimeout(() => {
instance.hide()