Merge pull request #282 from glowing-bear/fixonelinebug
Fix that bug where only one line was loaded
This commit is contained in:
commit
512f7d726b
1 changed files with 5 additions and 1 deletions
|
@ -892,7 +892,11 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
|
||||||
|
|
||||||
// Calculate number of lines to fetch
|
// Calculate number of lines to fetch
|
||||||
$scope.calculateNumLines = function() {
|
$scope.calculateNumLines = function() {
|
||||||
var lineHeight = document.querySelector(".bufferline").clientHeight;
|
var bufferlineElements = document.querySelectorAll(".bufferline");
|
||||||
|
var lineHeight = 0, idx = 0;
|
||||||
|
while (lineHeight === 0 && idx < bufferlineElements.length) {
|
||||||
|
lineHeight = bufferlineElements[idx++].clientHeight;
|
||||||
|
}
|
||||||
var areaHeight = document.querySelector("#bufferlines").clientHeight;
|
var areaHeight = document.querySelector("#bufferlines").clientHeight;
|
||||||
// Fetch 10 lines more than theoretically needed so that scrolling up will correctly trigger the loading of more lines
|
// Fetch 10 lines more than theoretically needed so that scrolling up will correctly trigger the loading of more lines
|
||||||
// Also, some lines might be hidden, so it's probably better to have a bit of buffer there
|
// Also, some lines might be hidden, so it's probably better to have a bit of buffer there
|
||||||
|
|
Loading…
Reference in a new issue