Fix var issues
This commit is contained in:
parent
835101e9d9
commit
0fa3eb2c09
@ -52,12 +52,12 @@ const displayPopup = (prmText, prmStatus) => {
|
|||||||
}, 50)
|
}, 50)
|
||||||
}
|
}
|
||||||
|
|
||||||
const copyTextToClipboard = (text, status) => {
|
const copyTextToClipboard = (prmText, prmStatus) => {
|
||||||
let textArea = document.createElement("textarea");
|
let textArea = document.createElement("textarea");
|
||||||
|
|
||||||
textArea.setAttribute('style', _settings.textareaStyle)
|
textArea.setAttribute('style', _settings.textareaStyle)
|
||||||
|
|
||||||
textArea.value = text;
|
textArea.value = prmText;
|
||||||
|
|
||||||
document.body.appendChild(textArea);
|
document.body.appendChild(textArea);
|
||||||
textArea.focus();
|
textArea.focus();
|
||||||
@ -66,15 +66,15 @@ const copyTextToClipboard = (text, status) => {
|
|||||||
try {
|
try {
|
||||||
let successful = document.execCommand('copy');
|
let successful = document.execCommand('copy');
|
||||||
let msg = successful ? 'successful' : 'unsuccessful';
|
let msg = successful ? 'successful' : 'unsuccessful';
|
||||||
if (successful) displayPopup(text + ' a bien été copié !', status ? status : 'success')
|
if (successful) displayPopup(prmText + ' a bien été copié !', prmStatus ? prmStatus : 'success')
|
||||||
else displayPopup(msg, status ? status : 'error')
|
else displayPopup(msg, prmStatus ? prmStatus : 'error')
|
||||||
} catch (err) {}
|
} catch (err) {}
|
||||||
document.body.removeChild(textArea);
|
document.body.removeChild(textArea);
|
||||||
}
|
}
|
||||||
|
|
||||||
const getPositionArray = chaine => {
|
const getPositionArray = prmString => {
|
||||||
const rule = /[-]?[0-9]{1,2}/g
|
const rule = /[-]?[0-9]{1,2}/g
|
||||||
return chaine.match(rule)
|
return prmString.match(rule)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!window.location.href.includes('dofus-map')) {
|
if (!window.location.href.includes('dofus-map')) {
|
||||||
|
Loading…
Reference in New Issue
Block a user