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:
parent
895f8ca465
commit
27c6f96271
1 changed files with 9 additions and 15 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue