Merge branch 'minimal-double-reader' into rwd
[wolnelektury.git] / apps / wolnelektury_core / static / js / book_text / box.js
1 $(function() {
2     /* Toggle hidden box on click. */
3     $("nav a[data-box]").each(function() {
4         $("#" + $(this).attr("data-box")).hide();
5
6         $(this).click(function(e) {
7             e.preventDefault();
8             var showing = $(this).hasClass("active");
9             $("nav .active").each(function() {
10                 $(this).removeClass("active");
11                 $("#" + $(this).attr("data-box")).hide();
12             });
13             if (!showing) {
14                 $(this).addClass("active");
15                 $("#" + $(this).attr("data-box")).show();
16             }
17         });
18     });
19 });