Skip to content

Commit

Permalink
Merge pull request #24 from theohbrothers/enhancement/keyboard-suppor…
Browse files Browse the repository at this point in the history
…t-scrolling-to-beginning-at-end-and-to-end-from-beginning

Enhancement (keyboard): Support scrolling to beginning at end, and to end from beginning
  • Loading branch information
leojonathanoh authored Sep 11, 2021
2 parents d697a1e + 044fa9a commit d84bdee
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ Keyboard shortcuts:
|---|---|
| LEFT | Previous image
| RIGHT | Next image
| UP | Previous image (of previous row in tiled view)
| DOWN | Next image (of next row in tiled view)
| UP | Previous image, or previous row in tile mode
| DOWN | Next image, or next row in tile mode
| ENTER | Expand image
| BACKSPACE | Back to tiled view
| BACKSPACE | Back to tile mode
| SPACE | Next image
| ESC | Escape from full screen, or back to tile mode
| `F` | Mode: Full screen
Expand Down
6 changes: 4 additions & 2 deletions webize
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,8 @@ cat - >> "$indexHtm" <<'EOF'
var setPreviousImageAsActiveImage = function() {
if (activeImageIndex <= 0) {
setActiveImageIndex(0, true);
// Go to end
setActiveImageIndex(images.length - 1, true);
}else {
var imageholder = images[activeImageIndex].parentNode;
var idx = Array.from(imageholder.parentNode.children).indexOf(imageholder); // Wrapper
Expand All @@ -589,7 +590,8 @@ cat - >> "$indexHtm" <<'EOF'
var setNextImageAsActiveImage = function() {
if (activeImageIndex >= images.length - 1) {
setActiveImageIndex(images.length - 1, true);
// Go to start
setActiveImageIndex(0, true);
}else {
var imageholder = images[activeImageIndex].parentNode;
var idx = Array.from(imageholder.parentNode.children).indexOf(imageholder); // Wrapper
Expand Down

0 comments on commit d84bdee

Please sign in to comment.