feat(navigation): add support for vi bindings
- navigation to previous is `h` key similar to left arrow - navigation to next is `l` key similar to right arrow
This commit is contained in:
parent
cf2459f730
commit
8ab5ac892e
|
@ -539,6 +539,7 @@ function playground_text(playground) {
|
||||||
|
|
||||||
switch (e.key) {
|
switch (e.key) {
|
||||||
case 'ArrowRight':
|
case 'ArrowRight':
|
||||||
|
case 'l':
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
var nextButton = document.querySelector('.nav-chapters.next');
|
var nextButton = document.querySelector('.nav-chapters.next');
|
||||||
if (nextButton) {
|
if (nextButton) {
|
||||||
|
@ -546,6 +547,7 @@ function playground_text(playground) {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'ArrowLeft':
|
case 'ArrowLeft':
|
||||||
|
case 'h':
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
var previousButton = document.querySelector('.nav-chapters.previous');
|
var previousButton = document.querySelector('.nav-chapters.previous');
|
||||||
if (previousButton) {
|
if (previousButton) {
|
||||||
|
|
Loading…
Reference in New Issue