fix slow scrolling
This commit is contained in:
parent
c03072f0e0
commit
38408ecde0
@ -1141,11 +1141,12 @@ recaptcha.addEventListener('keydown', recaptchaListener, true)
|
|||||||
|
|
||||||
scroll = ->
|
scroll = ->
|
||||||
height = document.body.clientHeight
|
height = document.body.clientHeight
|
||||||
while reply = g.replies[0]
|
for reply, i in g.replies
|
||||||
bottom = reply.getBoundingClientRect().bottom
|
bottom = reply.getBoundingClientRect().bottom
|
||||||
if bottom > height #post is not completely read
|
if bottom > height #post is not completely read
|
||||||
break
|
break
|
||||||
g.replies.shift()
|
if i is 0 then return
|
||||||
|
g.replies = g.replies[i..]
|
||||||
updateTitle()
|
updateTitle()
|
||||||
|
|
||||||
#major features
|
#major features
|
||||||
|
|||||||
11
4chan_x.js
11
4chan_x.js
@ -1429,15 +1429,20 @@
|
|||||||
recaptcha = $('#recaptcha_response_field');
|
recaptcha = $('#recaptcha_response_field');
|
||||||
recaptcha.addEventListener('keydown', recaptchaListener, true);
|
recaptcha.addEventListener('keydown', recaptchaListener, true);
|
||||||
scroll = function() {
|
scroll = function() {
|
||||||
var bottom, height, reply;
|
var bottom, height, i, reply, _len, _ref;
|
||||||
height = document.body.clientHeight;
|
height = document.body.clientHeight;
|
||||||
while (reply = g.replies[0]) {
|
_ref = g.replies;
|
||||||
|
for (i = 0, _len = _ref.length; i < _len; i++) {
|
||||||
|
reply = _ref[i];
|
||||||
bottom = reply.getBoundingClientRect().bottom;
|
bottom = reply.getBoundingClientRect().bottom;
|
||||||
if (bottom > height) {
|
if (bottom > height) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
g.replies.shift();
|
|
||||||
}
|
}
|
||||||
|
if (i === 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
g.replies = g.replies.slice(i);
|
||||||
return updateTitle();
|
return updateTitle();
|
||||||
};
|
};
|
||||||
if (getConfig('Restore IDs')) {
|
if (getConfig('Restore IDs')) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user