Throw a debounce back in for performance
A scroll-event-based function every tenth of a second is better than whatever arbitrary timer scroll events can have.
This commit is contained in:
parent
a7ce01cb61
commit
f782b0d3c0
@ -9694,7 +9694,7 @@
|
|||||||
}
|
}
|
||||||
return arr.splice(0, i);
|
return arr.splice(0, i);
|
||||||
},
|
},
|
||||||
read: function(e) {
|
read: $.debounce(100, function(e) {
|
||||||
var ID, height, post, posts;
|
var ID, height, post, posts;
|
||||||
if (d.hidden || !Unread.posts.length) {
|
if (d.hidden || !Unread.posts.length) {
|
||||||
return;
|
return;
|
||||||
@ -9722,7 +9722,7 @@
|
|||||||
if (e) {
|
if (e) {
|
||||||
return Unread.update();
|
return Unread.update();
|
||||||
}
|
}
|
||||||
},
|
}),
|
||||||
saveLastReadPost: $.debounce(2 * $.SECOND, function() {
|
saveLastReadPost: $.debounce(2 * $.SECOND, function() {
|
||||||
if (Unread.thread.isDead) {
|
if (Unread.thread.isDead) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@ -9677,7 +9677,7 @@
|
|||||||
}
|
}
|
||||||
return arr.splice(0, i);
|
return arr.splice(0, i);
|
||||||
},
|
},
|
||||||
read: function(e) {
|
read: $.debounce(100, function(e) {
|
||||||
var ID, height, post, posts;
|
var ID, height, post, posts;
|
||||||
if (d.hidden || !Unread.posts.length) {
|
if (d.hidden || !Unread.posts.length) {
|
||||||
return;
|
return;
|
||||||
@ -9705,7 +9705,7 @@
|
|||||||
if (e) {
|
if (e) {
|
||||||
return Unread.update();
|
return Unread.update();
|
||||||
}
|
}
|
||||||
},
|
}),
|
||||||
saveLastReadPost: $.debounce(2 * $.SECOND, function() {
|
saveLastReadPost: $.debounce(2 * $.SECOND, function() {
|
||||||
if (Unread.thread.isDead) {
|
if (Unread.thread.isDead) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@ -135,7 +135,7 @@ Unread =
|
|||||||
break if post.ID > Unread.lastReadPost
|
break if post.ID > Unread.lastReadPost
|
||||||
arr.splice 0, i
|
arr.splice 0, i
|
||||||
|
|
||||||
read: (e) ->
|
read: $.debounce 100, (e) ->
|
||||||
return if d.hidden or !Unread.posts.length
|
return if d.hidden or !Unread.posts.length
|
||||||
height = doc.clientHeight
|
height = doc.clientHeight
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user