Skip to content

Commit 9b506dc

Browse files
committed
Update global tooltip creation code to run only once as a workaround for scenarios that invoke it multiple times
1 parent 13ac125 commit 9b506dc

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

src/js/gui.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -294,10 +294,14 @@ class GuiControl {
294294
$(function () {
295295
for (const suffix of ["", "_wide"]) {
296296
$(`.cf_tip${suffix}`).each((_, element) => {
297-
createTooltip(element, {
298-
content: $(element).attr("title"),
299-
theme: `custom${suffix}`,
300-
});
297+
const jQueryElement = $(element);
298+
const attrTitle = jQueryElement.attr("title");
299+
if (attrTitle && !jQueryElement.hasClass("v-popper--has-tooltip")) {
300+
createTooltip(element, {
301+
content: attrTitle,
302+
theme: `custom${suffix}`,
303+
});
304+
}
301305
});
302306
}
303307
});

src/js/tabs/osd.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3944,10 +3944,14 @@ osd.initialize = function (callback) {
39443944
// Attach new tooltips
39453945
OSD.data.tooltips = $(".osd_tip").toArray();
39463946
for (const element of OSD.data.tooltips) {
3947-
createTooltip(element, {
3948-
content: $(element).attr("title"),
3949-
theme: "custom",
3950-
});
3947+
const jQueryElement = $(element);
3948+
const attrTitle = jQueryElement.attr("title");
3949+
if (attrTitle && !jQueryElement.hasClass("v-popper--has-tooltip")) {
3950+
createTooltip(element, {
3951+
content: attrTitle,
3952+
theme: "custom",
3953+
});
3954+
}
39513955
}
39523956
});
39533957
}

0 commit comments

Comments
 (0)