Changeset 12796


Ignore:
Timestamp:
Aug 30, 2011, 2:03:17 AM (12 years ago)
Author:
jordan
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/web/javascript/transmission.js

    r12795 r12796  
    488488                        var last = this.indexOfLastTorrent(),
    489489                            i = last,
    490                             anchor = this._shift_index;
    491 
    492                         if (dn)
    493                         {
    494                                 if (i === -1) // no selection yet
    495                                         i = 0;
    496                                 else
    497                                         i = (i+1) % rows.length;
    498                         }
    499                         else
    500                         {
    501                                 if (i === -1) // no selection yet
    502                                         i = rows.length - 1;
    503                                 else
    504                                         i = (i || rows.length) - 1;
    505                         }
     490                            anchor = this._shift_index,
     491                            r,
     492                            min = 0,
     493                            max = rows.length - 1;
     494
     495                        if (dn && (i+1 <= max))
     496                                ++i;
     497                        else if (up && (i-1 >= min))
     498                                --i;
     499
    506500                        var r = rows[i];
    507501
Note: See TracChangeset for help on using the changeset viewer.