Skip to content

Commit

Permalink
Allow keyboard navigation in browser on product detail pages, by fixi…
Browse files Browse the repository at this point in the history
…ng fotorama library to not change to a different image when pressing left or right arrow key in combination with certain modifier keys on your keyboard.
  • Loading branch information
hostep committed Sep 23, 2018
1 parent 8fd89cf commit d134a23
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/web/fotorama/fotorama.js
Original file line number Diff line number Diff line change
Expand Up @@ -1951,10 +1951,10 @@ fotoramaVersion = '4.6.4';
if (e.keyCode === 27) {
catched = true;
that.cancelFullScreen();
} else if ((e.shiftKey && e.keyCode === 32 && allowKey('space')) || (e.keyCode === 37 && allowKey('left')) || (e.keyCode === 38 && allowKey('up') && $(':focus').attr('data-gallery-role'))) {
} else if ((e.shiftKey && e.keyCode === 32 && allowKey('space')) || (!e.altKey && !e.metaKey && e.keyCode === 37 && allowKey('left')) || (e.keyCode === 38 && allowKey('up') && $(':focus').attr('data-gallery-role'))) {
that.longPress.progress();
index = '<';
} else if ((e.keyCode === 32 && allowKey('space')) || (e.keyCode === 39 && allowKey('right')) || (e.keyCode === 40 && allowKey('down') && $(':focus').attr('data-gallery-role'))) {
} else if ((e.keyCode === 32 && allowKey('space')) || (!e.altKey && !e.metaKey && e.keyCode === 39 && allowKey('right')) || (e.keyCode === 40 && allowKey('down') && $(':focus').attr('data-gallery-role'))) {
that.longPress.progress();
index = '>';
} else if (e.keyCode === 36 && allowKey('home')) {
Expand Down Expand Up @@ -3553,7 +3553,7 @@ fotoramaVersion = '4.6.4';

if ((result.moved || (toggleControlsFLAG && result.pos !== result.newPos && !result.control)) && result.$target[0] !== $fullscreenIcon[0]) {
var index = getIndexByPos(result.newPos, measures.w, opts.margin, repositionIndex);

that.show({
index: index,
time: o_fade ? o_transitionDuration : result.time,
Expand Down
2 changes: 1 addition & 1 deletion lib/web/fotorama/fotorama.min.js

Large diffs are not rendered by default.

0 comments on commit d134a23

Please sign in to comment.