From dbbf5ff718a45b4ba671312b4c0009a80e0abae1 Mon Sep 17 00:00:00 2001 From: MatMoul Date: Fri, 3 Nov 2017 21:02:57 +0100 Subject: [PATCH] Feature: Add page up and page down to change page --- src/js/dial.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/js/dial.js b/src/js/dial.js index 17f71aa..a09195d 100644 --- a/src/js/dial.js +++ b/src/js/dial.js @@ -30,6 +30,22 @@ window.onwheel = function(ev){ } } } +window.addEventListener('keyup', function(e){ + switch(e.key){ + case 'PageDown': + if(dial.page < dial.maxpage){ + dial.page += 1; + dial.populateGrid(); + } + break; + case 'PageUp': + if(dial.page > 1){ + dial.page -= 1; + dial.populateGrid(); + } + break; + } +});