Skip to content

Commit ec07b04

Browse files
committed
Update global tooltip creation code to run only once as a workaround for the Motors tab which invokes content_ready multiple times
1 parent 13ac125 commit ec07b04

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/js/gui.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -294,10 +294,16 @@ 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+
// Checks for presence of title and tooltip class are for
299+
// the Motors tab which initializes multiple times
300+
const attrTitle = jQueryElement.attr("title");
301+
if (attrTitle && !jQueryElement.hasClass("v-popper--has-tooltip")) {
302+
createTooltip(element, {
303+
content: attrTitle,
304+
theme: `custom${suffix}`,
305+
});
306+
}
301307
});
302308
}
303309
});

0 commit comments

Comments
 (0)