Round higher

Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
This commit is contained in:
John Molakvoæ (skjnldsv) 2017-08-25 04:58:07 +02:00
parent 3ea9002268
commit 4e0acaa0a6
No known key found for this signature in database
GPG Key ID: FB5ACEED51955BF8
1 changed files with 3 additions and 3 deletions

View File

@ -113,10 +113,10 @@ angular.module('contactsApp')
var elHeight = $('.contacts-list').children().outerHeight(true);
var listHeight = $('.app-content-list').height();
var topContact = Math.round(scrolled/elHeight-1);
var contactsCount = Math.round(listHeight/elHeight+1);
var topContact = Math.round(scrolled/elHeight);
var contactsCount = Math.round(listHeight/elHeight);
return ctrl.contactList.slice(topContact, topContact+contactsCount);
return ctrl.contactList.slice(topContact-1, topContact+contactsCount+1);
};
var timeoutId = null;