aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/LXRng/Web.pm6
-rw-r--r--tmpl/tree_list.tt29
2 files changed, 12 insertions, 3 deletions
diff --git a/lib/LXRng/Web.pm b/lib/LXRng/Web.pm
index ba7943f..2ae3fa4 100644
--- a/lib/LXRng/Web.pm
+++ b/lib/LXRng/Web.pm
@@ -219,9 +219,11 @@ sub print_tree_list {
$base =~ s,[+]trees/?$,,;
$template->process('tree_list.tt2',
{'context' => $context,
- 'base_url' => $base})
+ 'base_url' => $base,
+ 'is_ajax' => ($context->prefs and
+ $context->prefs->{'navmethod'} eq 'ajax')})
or die $template->error();
-}
+}
sub print_release_list {
my ($context, $template) = @_;
diff --git a/tmpl/tree_list.tt2 b/tmpl/tree_list.tt2
index d862cae..e517d0c 100644
--- a/tmpl/tree_list.tt2
+++ b/tmpl/tree_list.tt2
@@ -8,7 +8,14 @@
<script type="text/javascript" src=".static/js/lxrng-funcs.js"></script>
<link rel="shortcut icon" href=".static/gfx/favicon.png" type="image/png">
<link rel="stylesheet" href=".static/css/lxrng.css" type="text/css" title="LXRng">
-
+ [% IF !is_ajax %]
+ <script type="text/javascript">
+ var hashnav = location.hash.match(/^#(.+)/);
+ if (hashnav) {
+ document.write('<meta http-equiv="Refresh" content="0;url=[% base_url | html %]' + hashnav[1] + '">');
+ }
+ </script>
+ [% END %]
<title id="title">LXR Inventory</title>
</head>
<body>