Skip to content

Commit

Permalink
suggestions by @empiricompany
Browse files Browse the repository at this point in the history
  • Loading branch information
fballiano committed Apr 30, 2024
1 parent 4063c45 commit fca3b9c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions js/varien/js.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
}
Expand All @@ -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;
Expand Down

0 comments on commit fca3b9c

Please sign in to comment.