Fix onclick listeners for non-<a> elements
parent
0fd35925b5
commit
a80fd2e5bd
|
@ -103,11 +103,9 @@ const shareon = () => {
|
||||||
child.setAttribute('rel', 'noopener noreferrer');
|
child.setAttribute('rel', 'noopener noreferrer');
|
||||||
child.setAttribute('target', '_blank');
|
child.setAttribute('target', '_blank');
|
||||||
} else {
|
} else {
|
||||||
const getButtonListener = (buttonUrl) => () => {
|
child.onclick = () => {
|
||||||
window.open(buttonUrl, '_blank', 'noopener,noreferrer');
|
window.open(url, '_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