Skip to content

Commit

Permalink
Merge pull request #649 from lokesh/remove-alpha-key-press-shortcuts
Browse files Browse the repository at this point in the history
Remove alpha key press shortcuts
  • Loading branch information
lokesh authored Apr 20, 2019
2 parents 9ea5e60 + b6ea928 commit e2088a4
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/js/lightbox.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*!
* Lightbox v2.10.0
* Lightbox v2.11.0
* by Lokesh Dhakar
*
* More info:
* http://lokeshdhakar.com/projects/lightbox2/
*
* Copyright 2007, 2018 Lokesh Dhakar
* Copyright Lokesh Dhakar
* Released under the MIT license
* https://github.com/lokesh/lightbox2/blob/master/LICENSE
*
Expand Down Expand Up @@ -500,16 +500,15 @@
var KEYCODE_RIGHTARROW = 39;

var keycode = event.keyCode;
var key = String.fromCharCode(keycode).toLowerCase();
if (keycode === KEYCODE_ESC || key.match(/x|o|c/)) {
if (keycode === KEYCODE_ESC) {
this.end();
} else if (key === 'p' || keycode === KEYCODE_LEFTARROW) {
} else if (keycode === KEYCODE_LEFTARROW) {
if (this.currentImageIndex !== 0) {
this.changeImage(this.currentImageIndex - 1);
} else if (this.options.wrapAround && this.album.length > 1) {
this.changeImage(this.album.length - 1);
}
} else if (key === 'n' || keycode === KEYCODE_RIGHTARROW) {
} else if (keycode === KEYCODE_RIGHTARROW) {
if (this.currentImageIndex !== this.album.length - 1) {
this.changeImage(this.currentImageIndex + 1);
} else if (this.options.wrapAround && this.album.length > 1) {
Expand Down

0 comments on commit e2088a4

Please sign in to comment.