Skip to content
Snippets Groups Projects
Commit 42d809a5 authored by echicken's avatar echicken
Browse files

Improved end / page up / page down

parent 08217fd3
Branches
Tags
No related merge requests found
......@@ -177,19 +177,18 @@ ScrollBox.prototype.getcmd = function (c) {
return true;
}
if (c == KEY_END) {
this.scroll_into_view(this.wrap_map.length - 1);
this.y = this._text.length - 1 - this.height;
this._load();
return true;
}
if (c == KEY_PAGEUP) {
this.scroll_to(Math.max(0, this.y - this.height - 1));
this.y = Math.max(0, this.y - this.height);
this._load();
return true;
}
if (c == KEY_PAGEDN) {
if (this.y + this.height + 1 >= this.wrap_map.length - 1) {
this.scroll_into_view(this.wrap_map.length - 1);
} else {
this.scroll_to(this.y + this.height + 1);
}
this.y = Math.min(this._text.length - 1 - this.height, this.y + this.height);
this._load();
return true;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment