From 48a07ee1febe6d42f59a98ab7c925abb4088f10a Mon Sep 17 00:00:00 2001 From: David Cormier Date: Thu, 26 Jun 2014 22:36:30 -0400 Subject: [PATCH] Rename 'lines' to 'lines_per_screen' --- js/glowingbear.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/js/glowingbear.js b/js/glowingbear.js index a40822a..4869862 100644 --- a/js/glowingbear.js +++ b/js/glowingbear.js @@ -700,7 +700,7 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout', var ab = models.getActiveBuffer(); // trim lines to 2 screenfuls + 10 lines - ab.lines.splice(0, ab.lines.length - (2 * $scope.lines + 10)); + ab.lines.splice(0, ab.lines.length - (2 * $scope.lines_per_screen + 10)); ab.requestedLines = ab.lines.length; $scope.bufferlines = ab.lines; @@ -718,10 +718,10 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout', $scope.showNicklist = $scope.updateShowNicklist(); } - if (ab.requestedLines < $scope.lines) { + if (ab.requestedLines < $scope.lines_per_screen) { // buffer has not been loaded, but some lines may already be present if they arrived after we connected // try to determine how many lines to fetch - var numLines = $scope.lines; // that's a screenful plus 10 lines + var numLines = $scope.lines_per_screen; // that's a screenful plus 10 lines unreadSum += 10; // let's just add a 10 line safety margin here again if (unreadSum > numLines) { // request up to 4*(screenful + 10 lines) @@ -923,7 +923,7 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout', // 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 var numLines = Math.ceil(areaHeight/lineHeight + 10); - $scope.lines = numLines; + $scope.lines_per_screen = numLines; }; $scope.calculateNumLines(); @@ -957,7 +957,7 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout', $rootScope.loadingLines = false; $scope.fetchMoreLines = function(numLines) { if (!numLines) { - numLines = $scope.lines; + numLines = $scope.lines_per_screen; } return connection.fetchMoreLines(numLines); };