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