Mercurial > hg > mgallery
changeset 246:548a349bc015
Finally fix Chrome/Chromium support for keyboard navigation.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 03 May 2018 14:12:40 +0300 |
parents | 8ddf84b459d3 |
children | 384a8ed6687d |
files | mgallery.js mgallery.php |
diffstat | 2 files changed, 2 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/mgallery.js Tue May 01 16:00:40 2018 +0300 +++ b/mgallery.js Thu May 03 14:12:40 2018 +0300 @@ -50,7 +50,7 @@ function mgalProcessKeyPress(evt) { evt = evt || window.event; - var key = evt.keyCode ? evt.keyCode : evt.which; + var key = evt.keyCode ? evt.keyCode : (evt.charCode ? evt.charCode : evt.which); switch (key) { case 37:
--- a/mgallery.php Tue May 01 16:00:40 2018 +0300 +++ b/mgallery.php Thu May 03 14:12:40 2018 +0300 @@ -612,6 +612,7 @@ mgalAddEventOb("window", window, "resize", mgalAdjustImage); mgalAddEventOb("window", window, "load", mgalAdjustImage); mgalAddEventOb("document", document, "keypress", mgalProcessKeyPress); +mgalAddEventOb("document", document, "keydown", mgalProcessKeyPress); mgalAddEventOb("document", document, "touchstart", mgalTouchStart); mgalAddEventOb("document", document, "touchmove", mgalTouchMove);