mirror of
https://github.com/digitalocean/nginxconfig.io.git
synced 2025-10-15 02:49:20 +08:00
Use translated string in copy confirmation message (#383)
* Show message in the corresponding language when the user make clic on download button * Guardar una copia del texto original para usarla cuando la función de copia se haya resuelto con éxito * Resolving typos in the component and i18n * Saving the original text of the button to show it when the copy function throws an error exception Co-authored-by: Raul Soledispa <rsoledispa@technisys.com> Co-authored-by: Matt Cowley <me@mattcowley.co.uk>
This commit is contained in:
@@ -150,9 +150,7 @@ THE SOFTWARE.
|
||||
return this.tarContents().base64(path);
|
||||
},
|
||||
setupCopy(elm) {
|
||||
const originalText = elm.textContent;
|
||||
|
||||
const resetText = () => {
|
||||
const resetText = (originalText) => {
|
||||
setTimeout(() => {
|
||||
elm.textContent = originalText;
|
||||
}, 5000);
|
||||
@@ -163,14 +161,16 @@ THE SOFTWARE.
|
||||
});
|
||||
|
||||
clipboard.on('success', e => {
|
||||
elm.textContent = 'Copied';
|
||||
const originalTextCopy = elm.textContent;
|
||||
elm.textContent = this.$t('templates.app.copied');
|
||||
e.clearSelection();
|
||||
resetText();
|
||||
resetText(originalTextCopy);
|
||||
});
|
||||
|
||||
clipboard.on('error', () => {
|
||||
const originalTextCopy = elm.textContent;
|
||||
elm.textContent = 'Press Ctrl + C to copy';
|
||||
resetText();
|
||||
resetText(originalTextCopy);
|
||||
});
|
||||
},
|
||||
showTab(target) {
|
||||
|
Reference in New Issue
Block a user