aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEv Bogue <ev@evbogue.com>2020-01-26 09:46:00 -0600
committerEv Bogue <ev@evbogue.com>2020-01-26 09:46:00 -0600
commit078d3661e62e1dc87449aca8cabbf728b27ab89e (patch)
tree1ef95ee8614c352045798782cd07028889bfdaf8
parent16d261f8a2cb44d5364f5a993b800664236f4318 (diff)
predictive scrolling everywhere, remove logs
-rw-r--r--views.js24
1 files changed, 12 insertions, 12 deletions
diff --git a/views.js b/views.js
index f4b5569..85f45c4 100644
--- a/views.js
+++ b/views.js
@@ -24,10 +24,10 @@ function profilePage (src, keys) {
var timer = setInterval(function () {
if (window.location.hash.substring(1) != src) {
clearInterval(timer)
- console.log('stop syncing')
+ //console.log('stop syncing')
}
sync([src], keys)
- console.log('syncing ' + src)
+ //console.log('syncing ' + src)
}, 5000)
/*timer = function() {
@@ -154,12 +154,12 @@ function profilePage (src, keys) {
addPosts(posts, keys).then(done => {
index = index + 33
window.onscroll = function(ev) {
- console.log(document.body.scrollHeight)
+ //console.log(document.body.scrollHeight)
if (((window.innerHeight + window.scrollY) >= (document.body.scrollHeight - 2500)) && (window.location.hash.substring(1) === src)) {
posts = log.slice(index, index + 33)
index = index + 33
addPosts(posts, keys)
- console.log("Bottom of page")
+ //console.log("Bottom of page")
}
}
})
@@ -182,15 +182,15 @@ function searchPage (src, keys) {
bog().then(log => {
var index = 0
if (log) {
- var posts = log.slice(index, index + 25)
+ var posts = log.slice(index, index + 33)
addPosts(posts, keys).then(done => {
- index = index + 25
+ index = index + 33
window.onscroll = function(ev) {
- if (((window.innerHeight + window.scrollY) >= document.body.scrollHeight) && (window.location.hash.substring(1) === src)) {
- posts = log.slice(index, index + 25)
- index = index + 25
+ if (((window.innerHeight + window.scrollY) >= document.body.scrollHeight - 2500) && (window.location.hash.substring(1) === src)) {
+ posts = log.slice(index, index + 33)
+ index = index + 33
addPosts(posts, keys)
- console.log("Bottom of page")
+ //console.log("Bottom of page")
}
}
})
@@ -215,10 +215,10 @@ function publicPage (keys) {
setTimeout(function () {
if (window.location.hash.substring(1) != '') {
clearInterval(timer)
- console.log('stop syncing')
+ //console.log('stop syncing')
}
sync([sub], keys)
- console.log('syncing ' + sub)
+ //console.log('syncing ' + sub)
}, 1000 * index)
}, 2500)