Permalink
Browse files

filter by summary lines

  • Loading branch information...
moritz committed Aug 15, 2011
1 parent e5be355 commit 810341ea85fcdd12c832d53c58ef843dbf8b54c5
Showing with 12 additions and 2 deletions.
  1. +12 −2 cgi/summary.js
View
@@ -1,6 +1,6 @@
+var summary_filter_link = '<a href="javascript:hide_non_summary()">show only summary lines</a>';
$(document).ready(function() {
- $('#summary_container').html('<a href="javascript:save_summary_changes()">Save summary changes</a>');
-
+ $('#summary_container').html('<a href="javascript:save_summary_changes()">Save summary changes</a>, <span id="toggle_summary">' + summary_filter_link + '</span>');
});
function save_summary_changes() {
@@ -24,3 +24,13 @@ function save_summary_changes() {
$.post("/save_summary.pl", { check: newly_checked.join('.'), uncheck: was_checked.join('.') } );
}
}
+
+function hide_non_summary() {
+ $('.summary_checkbox:not(:checked)').parent().parent().hide();
+ $('#toggle_summary').html('<a href="javascript:show_all_rows()">show all lines</a>');
+}
+
+function show_all_rows() {
+ $('.summary_checkbox').parent().parent().show();
+ $('#toggle_summary').html(summary_filter_link);
+}

0 comments on commit 810341e

Please sign in to comment.