Make allLinesFetched an attribute of buffer

Remove noMoreLines from the rootScope.
This commit is contained in:
David Cormier 2014-02-27 21:50:50 -05:00
parent 892dac5fbc
commit c4dc74ca8d
2 changed files with 3 additions and 6 deletions

View file

@ -232,7 +232,7 @@ $ openssl req -nodes -newkey rsa:4096 -keyout relay.pem -x509 -days 365 -out rel
<table ng-class="{'notimestamp':notimestamp}">
<tbody>
<tr class="bufferline">
<td ng-hide="noMoreLines" colspan="3">
<td ng-hide="activeBuffer().allLinesFetched" colspan="3">
<a class="fetchmorelines" ng-click="fetchMoreLines()" ng-hide="loadingLines">Fetch more lines</a>
<span ng-show="loadingLines">Fetching more lines...</span>
</td>

View file

@ -450,11 +450,11 @@ function($rootScope,
}
// We request more lines, but didn't get more. No more lines!
if (oldLength === buffer.lines.length) {
$rootScope.noMoreLines = true;
buffer.allLinesFetched = true;
}
// We requested more lines than we got, no more lines.
if (linesReceivedCount < numLines) {
$rootScope.noMoreLines = true;
buffer.allLinesFetched = true;
}
$rootScope.loadingLines = false;
// Scroll read marker to the center of the screen
@ -594,9 +594,6 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
$rootScope.$on('activeBufferChanged', function() {
$rootScope.scrollWithBuffer(true);
// Reset no more lines
$rootScope.noMoreLines = false;
var ab = models.getActiveBuffer();
if (ab.requestedLines < $scope.lines) {
// buffer has not been loaded, but some lines may already be present if they arrived after we connected