Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/site
diff options
context:
space:
mode:
authorGeoSot <geo.sotis@gmail.com>2022-03-11 18:56:57 +0300
committerGitHub <noreply@github.com>2022-03-11 18:56:57 +0300
commit05c6e7dd66c10af8b2f8345b48c26de12f769335 (patch)
tree468bb864030c9ddce14e0364e37c3f2666882b02 /site
parent5bdd5e02a46101b96e83431b18c39979e337c033 (diff)
Fix docs error after #35644 (#36002)
Diffstat (limited to 'site')
-rw-r--r--site/assets/js/application.js24
1 files changed, 13 insertions, 11 deletions
diff --git a/site/assets/js/application.js b/site/assets/js/application.js
index 1719ed9f2a..0603f52c3a 100644
--- a/site/assets/js/application.js
+++ b/site/assets/js/application.js
@@ -127,22 +127,24 @@
/**
*
- * @param {HTMLButtonElement} btn
+ * @param {string} selector
* @param {string} title
*/
- function snippetButtonTooltip(btn, title) {
- var tooltipBtn = new bootstrap.Tooltip(btn, { title: title })
-
- btn.addEventListener('mouseleave', function () {
- // Explicitly hide tooltip, since after clicking it remains
- // focused (as it's a button), so tooltip would otherwise
- // remain visible until focus is moved away
- tooltipBtn.hide()
+ function snippetButtonTooltip(selector, title) {
+ document.querySelectorAll(selector).forEach(function (btn) {
+ var tooltipBtn = new bootstrap.Tooltip(btn, { title: title })
+
+ btn.addEventListener('mouseleave', function () {
+ // Explicitly hide tooltip, since after clicking it remains
+ // focused (as it's a button), so tooltip would otherwise
+ // remain visible until focus is moved away
+ tooltipBtn.hide()
+ })
})
}
- snippetButtonTooltip(document.querySelector('.btn-clipboard'), 'Copy to clipboard')
- snippetButtonTooltip(document.querySelector('.btn-edit'), 'Edit on Stackblitz')
+ snippetButtonTooltip('.btn-clipboard', 'Copy to clipboard')
+ snippetButtonTooltip('.btn-edit', 'Edit on Stackblitz')
var clipboard = new ClipboardJS('.btn-clipboard', {
target: function (trigger) {