A fork of https://github.com/ueokande/vim-vixen
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
536 B
28 lines
536 B
7 years ago
|
const SCROLL_DELTA = 48;
|
||
|
|
||
|
const scrollUp = (page) => {
|
||
|
let x = page.scrollX;
|
||
|
var y = page.scrollY - SCROLL_DELTA;
|
||
|
page.scrollTo(x, y);
|
||
|
};
|
||
|
|
||
|
const scrollDown = (page) => {
|
||
|
let x = page.scrollX;
|
||
|
var y = page.scrollY + SCROLL_DELTA;
|
||
|
page.scrollTo(x, y);
|
||
|
};
|
||
|
|
||
|
const scrollToTop = (page) => {
|
||
|
let x = page.scrollX;
|
||
|
var y = page.scrollMaxY;
|
||
|
page.scrollTo(x, y);
|
||
|
};
|
||
|
|
||
|
const scrollToBottom = (page) => {
|
||
|
let x = page.scrollX;
|
||
|
var y = 0;
|
||
|
page.scrollTo(x, y);
|
||
|
};
|
||
|
|
||
|
export { scrollUp, scrollDown, scrollToTop, scrollToBottom }
|