Skip to content

Commit

Permalink
Merge pull request #63 from OblivionCloudControl/develop
Browse files Browse the repository at this point in the history
fix: copied btn text mechanism
  • Loading branch information
jakubnakielskixebia authored Jul 25, 2024
2 parents 94387c9 + 2ed4b21 commit 8933748
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/xebia_email_signature/static/scripts-new.js
Original file line number Diff line number Diff line change
Expand Up @@ -589,14 +589,16 @@ function signatureCopyHtmlInit() {

function setBtnActionText(btn, text) {
let btnTextEl = btn.querySelector('span');
let btnOriginalText = btnTextEl.innerText;
let btnOriginalText = btn.dataset.originalText || btnTextEl.innerText;

btn.disabled = true;
btn.dataset.originalText = btnOriginalText;
btnTextEl.innerText = text;
if (!btnTextEl.textTimeout) {
btnTextEl.textTimeout = setTimeout(() => {
btnTextEl.innerText = btnOriginalText;
}, 3000);
}

btnTextEl.textTimeout = setTimeout(() => {
btnTextEl.innerText = btnOriginalText;
btn.disabled = false;
}, 1000);
}

async function iframePrepare(options = {}) {
Expand Down

0 comments on commit 8933748

Please sign in to comment.