From 5f19b0f616409a9d7490bc69290dd0f0bcaa7f8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Weber?= Date: Sat, 25 Feb 2023 00:32:30 +0100 Subject: [PATCH] i18n: fix tooltip alignment after last change #492 --- static/js/theme.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/static/js/theme.js b/static/js/theme.js index 75afadd4fd..2e8eef80ad 100644 --- a/static/js/theme.js +++ b/static/js/theme.js @@ -368,11 +368,13 @@ function initCodeClipboard(){ clip.on( 'success', function( e ){ e.clearSelection(); + var inPre = e.trigger.parentNode.tagName.toLowerCase() == 'pre'; e.trigger.setAttribute( 'aria-label', window.T_Copied_to_clipboard ); e.trigger.classList.add( 'tooltipped', 'tooltipped-' + (inPre ? 'w' : 's'+(isRtl?'e':'w')) ); }); clip.on( 'error', function( e ){ + var inPre = e.trigger.parentNode.tagName.toLowerCase() == 'pre'; e.trigger.setAttribute( 'aria-label', fallbackMessage(e.action) ); e.trigger.classList.add( 'tooltipped', 'tooltipped-' + (inPre ? 'w' : 's'+(isRtl?'e':'w')) ); var f = function(){