Fix docs error after #35644 (#36002)

This commit is contained in:
GeoSot 2022-03-11 17:56:57 +02:00 committed by GitHub
parent 5bdd5e02a4
commit 05c6e7dd66
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 10 deletions

View File

@ -127,10 +127,11 @@
/** /**
* *
* @param {HTMLButtonElement} btn * @param {string} selector
* @param {string} title * @param {string} title
*/ */
function snippetButtonTooltip(btn, title) { function snippetButtonTooltip(selector, title) {
document.querySelectorAll(selector).forEach(function (btn) {
var tooltipBtn = new bootstrap.Tooltip(btn, { title: title }) var tooltipBtn = new bootstrap.Tooltip(btn, { title: title })
btn.addEventListener('mouseleave', function () { btn.addEventListener('mouseleave', function () {
@ -139,10 +140,11 @@
// remain visible until focus is moved away // remain visible until focus is moved away
tooltipBtn.hide() tooltipBtn.hide()
}) })
})
} }
snippetButtonTooltip(document.querySelector('.btn-clipboard'), 'Copy to clipboard') snippetButtonTooltip('.btn-clipboard', 'Copy to clipboard')
snippetButtonTooltip(document.querySelector('.btn-edit'), 'Edit on Stackblitz') snippetButtonTooltip('.btn-edit', 'Edit on Stackblitz')
var clipboard = new ClipboardJS('.btn-clipboard', { var clipboard = new ClipboardJS('.btn-clipboard', {
target: function (trigger) { target: function (trigger) {