diff options
author | Arne Georg Gleditsch <argggh@lxr.linpro.no> | 2007-11-30 10:43:22 +0100 |
---|---|---|
committer | Arne Georg Gleditsch <argggh@lxr.linpro.no> | 2007-11-30 10:43:22 +0100 |
commit | 149c5a18784979fe6c5e2f0722612463ae921bd8 (patch) | |
tree | c876b31edc3f3eb1921506db266a8e89995c761f | |
parent | 857f06eee09f93d5249dc2f379edf10b4d4f62a2 (diff) |
Correct logic.
-rw-r--r-- | cgi-bin/js/lxrng-funcs.js | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/cgi-bin/js/lxrng-funcs.js b/cgi-bin/js/lxrng-funcs.js index 90129fe..fdd9b43 100644 --- a/cgi-bin/js/lxrng-funcs.js +++ b/cgi-bin/js/lxrng-funcs.js @@ -136,9 +136,13 @@ function load_file(tree, file, ver, line) { clearTimeout(hash_check); } - if ((pending_tree == tree) && (pending_file == file)) { - location.hash = location.hash.replace(/\#L\d+$/, '') + - '#L' + line; + if ((pending_tree == tree) && + (pending_file == file) && + (pending_ver == ver)) + { + if (line > 0) + line = '#L' + line; + location.hash = location.hash.replace(/\#L\d+$/, '') + line; check_hash_navigation(); return false; } @@ -280,7 +284,7 @@ function update_version(verlist, base_url, tree, defversion, path) { if (use_ajax_navigation) { var file = location.hash.replace(/^[^\/]*\//, ''); var line = file.replace(/.*\#L(\d+)/, '$1'); - file = file.replace(/\#L\d+$/, ''); + file = file.replace(/\#L\d*$/, ''); load_file(loaded_tree, file, verlist.value, line); return false; |