more focus checks

This commit is contained in:
James Campos 2011-07-31 12:53:56 -07:00
parent 566672afe7
commit f38dd63a68
2 changed files with 6 additions and 2 deletions

View File

@ -726,6 +726,7 @@
},
keydown: function(e) {
var o, range, selEnd, selStart, ta, thread, valEnd, valMid, valStart, value, _ref, _ref2, _ref3;
updater.focus = true;
if (((_ref = e.target.nodeName) === 'TEXTAREA' || _ref === 'INPUT') && !e.altKey && !e.ctrlKey && !(e.keyCode === 27)) {
return;
}
@ -1650,7 +1651,7 @@
while ((reply = replies.pop()) && (reply.id > id)) {
arr.push(reply.parentNode.parentNode.parentNode);
}
scroll = updater.focus && arr.length && (d.body.scrollHeight - d.body.clientHeight - window.scrollY < 20);
scroll = conf['Scrolling'] && updater.focus && arr.length && (d.body.scrollHeight - d.body.clientHeight - window.scrollY < 20);
updater.timer.textContent = '-' + conf['Interval'];
if (conf['Verbose']) {
updater.count.textContent = '+' + arr.length;
@ -2324,6 +2325,7 @@
},
scroll: function(e) {
var bottom, height, i, reply, _len, _ref;
updater.focus = true;
height = d.body.clientHeight;
_ref = unread.replies;
for (i = 0, _len = _ref.length; i < _len; i++) {

View File

@ -518,6 +518,7 @@ keybinds =
$.bind d, 'keydown', keybinds.keydown
keydown: (e) ->
updater.focus = true
return if e.target.nodeName in ['TEXTAREA', 'INPUT'] and not e.altKey and not e.ctrlKey and not (e.keyCode is 27)
return unless key = keybinds.keyCode e
@ -1332,7 +1333,7 @@ updater =
while (reply = replies.pop()) and (reply.id > id)
arr.push reply.parentNode.parentNode.parentNode #table
scroll = updater.focus && arr.length && (d.body.scrollHeight - d.body.clientHeight - window.scrollY < 20)
scroll = conf['Scrolling'] && updater.focus && arr.length && (d.body.scrollHeight - d.body.clientHeight - window.scrollY < 20)
updater.timer.textContent = '-' + conf['Interval']
if conf['Verbose']
@ -1770,6 +1771,7 @@ unread =
Favicon.update()
scroll: (e) ->
updater.focus = true
height = d.body.clientHeight
for reply, i in unread.replies
{bottom} = reply.getBoundingClientRect()