From 0d443849c571930b75d355e48c3e270ee4f590c8 Mon Sep 17 00:00:00 2001 From: Richard Iannone Date: Wed, 1 Apr 2026 17:39:54 -0400 Subject: [PATCH] Add keyboard shortcuts tooltip --- great_docs/assets/keyboard-nav.js | 15 +++++++++++++++ great_docs/assets/tooltips.js | 13 +++++++------ 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/great_docs/assets/keyboard-nav.js b/great_docs/assets/keyboard-nav.js index 9bcc580..c82e77e 100644 --- a/great_docs/assets/keyboard-nav.js +++ b/great_docs/assets/keyboard-nav.js @@ -589,6 +589,8 @@ btn.type = 'button'; btn.setAttribute('aria-label', _gdT('kb_show_help', 'Show keyboard shortcuts')); + btn.setAttribute('data-tippy-content', + _gdT('kb_show_help', 'Show keyboard shortcuts')); btn.innerHTML = ' 0) { needsReinit = true; } @@ -266,8 +266,9 @@ } }); - // Check for attribute changes (title being set) - if (mutation.type === "attributes" && mutation.attributeName === "title") { + // Check for attribute changes (title or data-tippy-content being set) + if (mutation.type === "attributes" && + (mutation.attributeName === "title" || mutation.attributeName === "data-tippy-content")) { needsReinit = true; } }); @@ -283,7 +284,7 @@ childList: true, subtree: true, attributes: true, - attributeFilter: ["title"], + attributeFilter: ["title", "data-tippy-content"], }); }