IRC scroll only when at the bottom
This commit is contained in:
parent
7b0666ad6d
commit
06a286a9fb
@ -1622,7 +1622,7 @@
|
|||||||
return updater.interval = this.value = this.value.match(/\d+/)[0];
|
return updater.interval = this.value = this.value.match(/\d+/)[0];
|
||||||
},
|
},
|
||||||
update: function() {
|
update: function() {
|
||||||
var arr, body, br, id, input, length, replies, reply, _i, _len, _ref, _ref2;
|
var arr, body, br, id, input, ircScroll, replies, reply, _i, _len, _ref, _ref2;
|
||||||
if (this.status === 404) {
|
if (this.status === 404) {
|
||||||
updater.timer.textContent = '';
|
updater.timer.textContent = '';
|
||||||
updater.count.textContent = 404;
|
updater.count.textContent = 404;
|
||||||
@ -1649,11 +1649,11 @@
|
|||||||
while ((reply = replies.pop()) && (reply.id > id)) {
|
while ((reply = replies.pop()) && (reply.id > id)) {
|
||||||
arr.push(reply.parentNode.parentNode.parentNode);
|
arr.push(reply.parentNode.parentNode.parentNode);
|
||||||
}
|
}
|
||||||
length = arr.length;
|
ircScroll = updater.ircUpd && arr.length && (document.height - document.body.clientHeight - window.scrollY - 20 <= 0);
|
||||||
updater.timer.textContent = '-' + updater.interval;
|
updater.timer.textContent = '-' + updater.interval;
|
||||||
if (updater.verbose) {
|
if (updater.verbose) {
|
||||||
updater.count.textContent = '+' + length;
|
updater.count.textContent = '+' + arr.length;
|
||||||
if (length === 0) {
|
if (arr.length === 0) {
|
||||||
updater.count.className = '';
|
updater.count.className = '';
|
||||||
} else {
|
} else {
|
||||||
updater.count.className = 'new';
|
updater.count.className = 'new';
|
||||||
@ -1662,7 +1662,7 @@
|
|||||||
while (reply = arr.pop()) {
|
while (reply = arr.pop()) {
|
||||||
$.before(br, reply);
|
$.before(br, reply);
|
||||||
}
|
}
|
||||||
if (updater.ircUpd && length) {
|
if (ircScroll) {
|
||||||
return scrollTo(0, d.body.scrollHeight);
|
return scrollTo(0, d.body.scrollHeight);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1348,12 +1348,12 @@ updater =
|
|||||||
replies = $$ 'td[id]', body
|
replies = $$ 'td[id]', body
|
||||||
while (reply = replies.pop()) and (reply.id > id)
|
while (reply = replies.pop()) and (reply.id > id)
|
||||||
arr.push reply.parentNode.parentNode.parentNode #table
|
arr.push reply.parentNode.parentNode.parentNode #table
|
||||||
length = arr.length
|
ircScroll = updater.ircUpd && arr.length && (document.height - document.body.clientHeight - window.scrollY - 20 <= 0)
|
||||||
|
|
||||||
updater.timer.textContent = '-' + updater.interval
|
updater.timer.textContent = '-' + updater.interval
|
||||||
if updater.verbose
|
if updater.verbose
|
||||||
updater.count.textContent = '+' + length
|
updater.count.textContent = '+' + arr.length
|
||||||
if length is 0
|
if arr.length is 0
|
||||||
updater.count.className = ''
|
updater.count.className = ''
|
||||||
else
|
else
|
||||||
updater.count.className = 'new'
|
updater.count.className = 'new'
|
||||||
@ -1361,7 +1361,7 @@ updater =
|
|||||||
#XXX add replies in correct order so backlinks resolve
|
#XXX add replies in correct order so backlinks resolve
|
||||||
while reply = arr.pop()
|
while reply = arr.pop()
|
||||||
$.before br, reply
|
$.before br, reply
|
||||||
if updater.ircUpd && length
|
if ircScroll
|
||||||
scrollTo 0, d.body.scrollHeight
|
scrollTo 0, d.body.scrollHeight
|
||||||
|
|
||||||
timeout: ->
|
timeout: ->
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user