fix kb thread nav
This commit is contained in:
parent
488b828515
commit
60db94c2ec
@ -376,9 +376,10 @@ keyAct = (e) ->
|
||||
char = String.fromCharCode kc
|
||||
hash = location.hash
|
||||
if not hash or hash == '#navtop'
|
||||
position = 0
|
||||
position = -1
|
||||
else
|
||||
position = Number(hash.substring 2) or 0
|
||||
temp = Number(hash.substring 2)
|
||||
position = if temp is NaN then -1 else temp
|
||||
count = g.count
|
||||
if char in '1234567890'
|
||||
temp = Number char
|
||||
@ -409,7 +410,7 @@ keyAct = (e) ->
|
||||
location.hash = 'p' + temp
|
||||
when "K"
|
||||
temp = position - count
|
||||
if temp <= 0 then temp = 'navtop' else temp = 'p' + temp
|
||||
if temp < 0 then temp = 'navtop' else temp = 'p' + temp
|
||||
location.hash = temp
|
||||
when "L"
|
||||
temp = g.PAGENUM + count
|
||||
|
||||
@ -464,9 +464,10 @@
|
||||
char = String.fromCharCode(kc);
|
||||
hash = location.hash;
|
||||
if (!hash || hash === '#navtop') {
|
||||
position = 0;
|
||||
position = -1;
|
||||
} else {
|
||||
position = Number(hash.substring(2)) || 0;
|
||||
temp = Number(hash.substring(2));
|
||||
position = temp === NaN ? -1 : temp;
|
||||
}
|
||||
count = g.count;
|
||||
if ((function(){ for (var _i=0, _len='1234567890'.length; _i<_len; _i++) { if ('1234567890'[_i] === char) return true; } return false; }).call(this)) {
|
||||
@ -509,7 +510,7 @@
|
||||
break;
|
||||
case "K":
|
||||
temp = position - count;
|
||||
if (temp <= 0) {
|
||||
if (temp < 0) {
|
||||
temp = 'navtop';
|
||||
} else {
|
||||
temp = 'p' + temp;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user