From c5be828d99a43e871572e205d41badeac1d1f70f Mon Sep 17 00:00:00 2001 From: Mohamad Salman <139472418+MohamadSalman11@users.noreply.github.com> Date: Sun, 9 Feb 2025 10:50:20 +0100 Subject: [PATCH] Docs: fix clipboard icon visibility issue after multiple clicks (#40917) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Julien Déramond --- site/assets/js/partials/code-examples.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/site/assets/js/partials/code-examples.js b/site/assets/js/partials/code-examples.js index 87791a759f..1e86df9f99 100644 --- a/site/assets/js/partials/code-examples.js +++ b/site/assets/js/partials/code-examples.js @@ -63,6 +63,11 @@ export default () => { const namespace = 'http://www.w3.org/1999/xlink' const originalXhref = iconFirstChild.getAttributeNS(namespace, 'href') const originalTitle = event.trigger.title + const isCheckIconVisible = originalXhref === '#check2' + + if (isCheckIconVisible) { + return + } tooltipBtn.setContent({ '.tooltip-inner': 'Copied!' }) event.trigger.addEventListener('hidden.bs.tooltip', () => {