From f387c3662f78edd23e091d317a04503735fe1cd1 Mon Sep 17 00:00:00 2001 From: MatMoul Date: Fri, 3 Nov 2017 21:11:57 +0100 Subject: [PATCH] Feature: Add page up and page down to change page --- src/js/dial.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/js/dial.js b/src/js/dial.js index a09195d..067c468 100644 --- a/src/js/dial.js +++ b/src/js/dial.js @@ -12,24 +12,24 @@ document.addEventListener("DOMContentLoaded", function(event) { dial.init(); }); -window.onresize = function(){ +window.addEventListener('resize', function(){ if(app && app.settings) dial.updateGridLayout(); -} -window.onwheel = function(ev){ +}); +window.addEventListener('wheel', function(e){ if(app && app.settings){ - if(ev.deltaY > 0){ + if(e.deltaY > 0){ if(dial.page < dial.maxpage){ dial.page += 1; dial.populateGrid(); } - } else if(ev.deltaY < 0){ + } else if(e.deltaY < 0){ if(dial.page > 1){ dial.page -= 1; dial.populateGrid(); } } } -} +}); window.addEventListener('keyup', function(e){ switch(e.key){ case 'PageDown':