simplify listener registration
since the function reference is constant, only one listener will be registered
This commit is contained in:
parent
e3d1526b52
commit
92d6530c8f
|
@ -583,10 +583,8 @@ function showHelp(title = '', body) {
|
||||||
window.dispatchEvent(new Event('closeHelp'));
|
window.dispatchEvent(new Event('closeHelp'));
|
||||||
});
|
});
|
||||||
|
|
||||||
if (getComputedStyle(div).display === 'none') {
|
window.addEventListener('keydown', showHelp.close, true);
|
||||||
window.addEventListener('keydown', showHelp.close, true);
|
$('.dismiss', div).onclick = showHelp.close;
|
||||||
$('.dismiss', div).onclick = showHelp.close;
|
|
||||||
}
|
|
||||||
|
|
||||||
// reset any inline styles
|
// reset any inline styles
|
||||||
div.style = 'display: block';
|
div.style = 'display: block';
|
||||||
|
|
Loading…
Reference in New Issue
Block a user