summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2019-09-16 11:31:47 +0200
committerYorhel <git@yorhel.nl>2019-09-16 11:31:49 +0200
commit297254136dd70f093f449832507c9eb7a0854c21 (patch)
tree7ffff95968852f5baff3aabfbb88e1089a107210
parentcaa61fc860b455ada9bf4f589f8d64307ce77314 (diff)
JS: Fix hiding of image viewer when clicking outside of document.body
Apparently the page background is not part of document.body.
-rw-r--r--data/js/iv.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/data/js/iv.js b/data/js/iv.js
index 8d9eef30..98889c5e 100644
--- a/data/js/iv.js
+++ b/data/js/iv.js
@@ -111,7 +111,7 @@ function show(ev) {
byId('ivimgload').style.top = ((wh - 20) / 2 + st)+'px';
setClass(byId('ivimgload'), 'hidden', false);
- document.body.onclick = close;
+ document.onclick = close;
// Capture left/right arrow keys
document.onkeydown = function(e) {
if(e.keyCode == 37 && byId('ivprev').style.visibility == 'visible') {
@@ -126,7 +126,7 @@ function show(ev) {
}
function close() {
- document.body.onclick = null;
+ document.onclick = null;
document.onkeydown = null;
setClass(byId('iv_view'), 'hidden', true);
setClass(byId('ivimgload'), 'hidden', true);