From 3ae5e40f8f9e98c8126f602bc5b40adeab93d2ec Mon Sep 17 00:00:00 2001 From: Marco Burstein Date: Thu, 19 Jul 2018 15:36:02 -0700 Subject: [PATCH] lightbox: Make `v` close the lightbox during Pan & Zoom. When Pan & Zoom (canvas) is enabled, the `v` hotkey does not work due to `LightboxCanvas` overriding the `keydown` event. Add `v` as an option in the new listener. Fix #9777. --- static/js/lightbox_canvas.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/static/js/lightbox_canvas.js b/static/js/lightbox_canvas.js index 10e056fffa..8a5d9efef6 100644 --- a/static/js/lightbox_canvas.js +++ b/static/js/lightbox_canvas.js @@ -158,6 +158,8 @@ var LightboxCanvas = (function () { } else if (e.key === "z" || e.key === '-') { funcs.setZoom(meta, '-'); funcs.displayImage(canvas, context, meta); + } else if (e.key === 'v') { + overlays.close_overlay('lightbox'); } e.preventDefault(); e.stopPropagation();