1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-25 01:03:01 +00:00

(trunk web) #4460 "Weird behavior when using up/down keys" -- fixed.

This commit is contained in:
Jordan Lee 2011-08-30 02:03:17 +00:00
parent 895f8ca465
commit 27c6f96271

View file

@ -487,22 +487,16 @@ Transmission.prototype =
{
var last = this.indexOfLastTorrent(),
i = last,
anchor = this._shift_index;
anchor = this._shift_index,
r,
min = 0,
max = rows.length - 1;
if (dn && (i+1 <= max))
++i;
else if (up && (i-1 >= min))
--i;
if (dn)
{
if (i === -1) // no selection yet
i = 0;
else
i = (i+1) % rows.length;
}
else
{
if (i === -1) // no selection yet
i = rows.length - 1;
else
i = (i || rows.length) - 1;
}
var r = rows[i];
if (anchor >= 0)