From fca3b9c06d671858bce07113159ab971877ade57 Mon Sep 17 00:00:00 2001 From: Fabrizio Balliano Date: Tue, 30 Apr 2024 13:12:39 +0100 Subject: [PATCH] suggestions by @empiricompany --- js/varien/js.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/js/varien/js.js b/js/varien/js.js index 5c68ae95dd9..37c01323231 100644 --- a/js/varien/js.js +++ b/js/varien/js.js @@ -715,7 +715,7 @@ function addCopyIcons() { const copyTexts = document.querySelectorAll('.copy-text'); copyTexts.forEach(copyText => { const iconStyle = JSON.parse(copyText.getAttribute('data-copy-icon')); - const svg = createSVGElement(iconStyle); + const svg = createCopyIconElement(iconStyle); copyText.parentNode.appendChild(svg); }); } @@ -730,10 +730,11 @@ function addCopyIcons() { * @param {string} [iconStyles.margin='0'] - The margin of the SVG element. * @return {HTMLElement} The created SVG element. */ -function createSVGElement(iconStyles) { +function createCopyIconElement(iconStyles) { const copyIcon = document.createElement('span'); copyIcon.classList.add('icon-copy'); copyIcon.setAttribute('onclick', 'copyText(event)'); + copyIcon.setAttribute('title', Translator.translate('Copy text to clipboard')); copyIcon.style.cursor = iconStyles.cursor || 'pointer'; copyIcon.style.height = iconStyles.height; copyIcon.style.width = iconStyles.width;