Fix button listeners

pull/21/head
Nikita Karamov 2020-09-18 20:24:22 +02:00
parent 6bda2f5abe
commit fb4a0651f9
No known key found for this signature in database
GPG Key ID: E40DFE6E993540FF
1 changed files with 5 additions and 3 deletions

View File

@ -57,9 +57,11 @@ const initializeShareon = () => {
child.setAttribute('rel', 'noopener noreferrer'); child.setAttribute('rel', 'noopener noreferrer');
child.setAttribute('target', '_blank'); child.setAttribute('target', '_blank');
} else { } else {
child.addEventListener('click', () => { const getButtonListener = (buttonUrl) => () => {
window.open(url, '_blank', 'noopener,noreferrer').opener = null; window.open(buttonUrl, '_blank', 'noopener,noreferrer');
}); };
child.addEventListener('click', getButtonListener(url));
} }
break; // once a network is detected we don't want to check further break; // once a network is detected we don't want to check further