Remove setting and calculate number of lines from display properties
This commit is contained in:
parent
56055d61c8
commit
8068be8de2
2 changed files with 15 additions and 13 deletions
|
@ -535,7 +535,6 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
|
|||
$store.bind($scope, "port", "9001");
|
||||
$store.bind($scope, "proto", "weechat");
|
||||
$store.bind($scope, "ssl", false);
|
||||
$store.bind($scope, "lines", "40");
|
||||
$store.bind($scope, "savepassword", false);
|
||||
if ($scope.savepassword) {
|
||||
$store.bind($scope, "password", "");
|
||||
|
@ -594,6 +593,15 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
|
|||
}
|
||||
};
|
||||
|
||||
|
||||
// Calculate number of lines to fetch
|
||||
$scope.lines = function() {
|
||||
var lineHeight = document.querySelector(".bufferline").clientHeight;
|
||||
// I would have used document.querySelector("#bufferlines").clientHeight and added 5 to the total result, but that provides incorrect values on mobile
|
||||
var areaHeight = document.body.clientHeight;
|
||||
return Math.ceil(areaHeight/lineHeight);
|
||||
}();
|
||||
|
||||
$rootScope.loadingLines = false;
|
||||
$scope.fetchMoreLines = function() {
|
||||
connection.fetchMoreLines($scope.lines);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue