browser: click title to expand
[sheet.git] / browser.plp
index ea23d0afae18702ac0d47b3e0d9c63e9b95f9feb..ce56bdb0ddd10bc6b1af74b0f42d1937eae57495 100644 (file)
@@ -146,7 +146,15 @@ for my $id (sort {
                my $cell = $_ ? lc $_->[0] : '-';
                print '<th>', $cell;
        }
-       print '<td>', $row->{title};
+       print '<td>', map {
+               sprintf('<a href="%s" onclick="%s">%s</a>',
+                       "#$id",
+                       sprintf("try { %s; return false } catch(err) { return true }",
+                               "document.getElementById('$id').classList.toggle('target')",
+                       ),
+                       $_,
+               );
+       } $row->{title};
        print '<div class=aside>';
        s/\.?$/./, print "<p>$_</p>" for map { ref $_ ? @$_ : $_ || () }
                $row->{description}, $row->{notes};