Hirale

Results 11 comments of Hirale

To add a copy icon to an element, follow these steps: Add the `data-copy-text` attribute, which holds the text content to be copied. For example: ```html ) ```

I think it is more convenient to use the special attributes of html tag.

@fballiano do you mean this? js/varien/js.js ``` javascript /** * Adds copy icons to elements with the class 'copy-text'. */ function addCopyIcons() { const copyTexts = document.querySelectorAll('.copy-text'); copyTexts.forEach(copyText => {...

> when I click the copy icon on the order number I get: which browser?

on chrome Version 124.0.6367.61 and firefox 125.0.2 (64-bit), works fine ![2024-04-29 23-52-06](https://github.com/OpenMage/magento-lts/assets/22028058/0277d74f-45a4-456a-a92f-f73cfb9893d0)

> chrome maybe here is the reason. Should I add some checks before writeText function? https://stackoverflow.com/questions/51805395/navigator-clipboard-is-undefined https://developer.mozilla.org/en-US/docs/Web/API/Clipboard/writeText https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts

I've added the `data-copy-text` attribute to the target element and styled it using a CSS class, as we discussed earlier.

https://apilayer.com/marketplace/fixer-api ![image](https://github.com/OpenMage/magento-lts/assets/22028058/533a7055-ab07-46dd-be87-98e1eac6a01e)

> @hirale what do you mean? that the currently used address is working fine? the current one works fine.

some third-party modules like admin action logs have something similar