Fix button listeners
parent
6bda2f5abe
commit
fb4a0651f9
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue