Guardar una copia del texto original para usarla cuando la función de copia se haya resuelto con éxito

pull/383/head
Raul Soledispa 2022-09-29 17:35:28 -05:00
parent dff80b7a90
commit a049a7c61e
9 changed files with 12 additions and 11 deletions

View File

@ -1,5 +1,5 @@
/* /*
Copyright 2021 DigitalOcean Copyright 2022 DigitalOcean
This code is licensed under the MIT License. This code is licensed under the MIT License.
You may obtain a copy of the License at You may obtain a copy of the License at

View File

@ -1,5 +1,5 @@
/* /*
Copyright 2020 DigitalOcean Copyright 2022 DigitalOcean
This code is licensed under the MIT License. This code is licensed under the MIT License.
You may obtain a copy of the License at You may obtain a copy of the License at

View File

@ -1,5 +1,5 @@
/* /*
Copyright 2021 DigitalOcean Copyright 2022 DigitalOcean
This code is licensed under the MIT License. This code is licensed under the MIT License.
You may obtain a copy of the License at You may obtain a copy of the License at

View File

@ -1,5 +1,5 @@
/* /*
Copyright 2021 DigitalOcean Copyright 2022 DigitalOcean
This code is licensed under the MIT License. This code is licensed under the MIT License.
You may obtain a copy of the License at You may obtain a copy of the License at

View File

@ -1,5 +1,5 @@
/* /*
Copyright 2021 DigitalOcean Copyright 2022 DigitalOcean
This code is licensed under the MIT License. This code is licensed under the MIT License.
You may obtain a copy of the License at You may obtain a copy of the License at

View File

@ -1,5 +1,5 @@
/* /*
Copyright 2020 DigitalOcean Copyright 2022 DigitalOcean
This code is licensed under the MIT License. This code is licensed under the MIT License.
You may obtain a copy of the License at You may obtain a copy of the License at

View File

@ -1,5 +1,5 @@
/* /*
Copyright 2021 DigitalOcean Copyright 2022 DigitalOcean
This code is licensed under the MIT License. This code is licensed under the MIT License.
You may obtain a copy of the License at You may obtain a copy of the License at

View File

@ -1,5 +1,5 @@
/* /*
Copyright 2020 DigitalOcean Copyright 2022 DigitalOcean
This code is licensed under the MIT License. This code is licensed under the MIT License.
You may obtain a copy of the License at You may obtain a copy of the License at

View File

@ -151,9 +151,9 @@ THE SOFTWARE.
}, },
setupCopy(elm) { setupCopy(elm) {
const resetText = () => { const resetText = (originalText) => {
setTimeout(() => { setTimeout(() => {
elm.textContent = this.$t('templates.setup.copyBase64'); elm.textContent = originalText;
}, 5000); }, 5000);
}; };
@ -162,9 +162,10 @@ THE SOFTWARE.
}); });
clipboard.on('success', e => { clipboard.on('success', e => {
const originalTextCopy = elm.textContent;
elm.textContent = this.$tm('templates.app.copied'); elm.textContent = this.$tm('templates.app.copied');
e.clearSelection(); e.clearSelection();
resetText(); resetText(originalTextCopy);
}); });
clipboard.on('error', () => { clipboard.on('error', () => {