make pageup key trigger fetch more lines

This commit is contained in:
Ailin Nemui 2014-09-22 14:54:27 +02:00
parent 0b481cce3d
commit 85ef764faf

View file

@ -292,6 +292,12 @@ weechat.directive('inputBar', function() {
// Page up -> scroll up
if ($event.type === "keydown" && code === 33 && document.activeElement === inputNode && !$event.ctrlKey && !$event.altKey && !$event.shiftKey) {
if (bufferlines.scrollTop === 0) {
if (!$rootScope.loadingLines) {
$scope.$parent.fetchMoreLines();
}
return true;
}
lines = bufferlines.querySelectorAll("tr");
for (i = lines.length - 1; i >= 0; i--) {
if ((lines[i].offsetTop-bufferlines.scrollTop)<bufferlines.clientHeight/2) {