1
0
mirror of https://github.com/MatMoul/quickdial-webext.git synced 2024-12-23 07:26:11 +00:00

Feature: Add page up and page down to change page

This commit is contained in:
MatMoul 2017-11-03 21:11:57 +01:00
parent dbbf5ff718
commit f387c3662f

View File

@ -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':