X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/145bf215dceaee2808be13e45e8c5c09907ecd36..884be9d702f99a38cd9b04c4fdedca887286f35d:/apps/wolnelektury_core/static/js/base.js diff --git a/apps/wolnelektury_core/static/js/base.js b/apps/wolnelektury_core/static/js/base.js index 5c7dc1129..9ba5631fa 100755 --- a/apps/wolnelektury_core/static/js/base.js +++ b/apps/wolnelektury_core/static/js/base.js @@ -85,13 +85,15 @@ } }); }); + /* this kinda breaks the whole page. */ $('body').click(function(e) { if ($current == null) return; var p = $(e.target); while (p.length) { if (p == $current) return; - if (p.hasClass('hidden-box-trigger')) + if (p.hasClass('hidden-box-trigger') + || p.hasClass('simple-toggler')) return; p = p.parent(); } @@ -105,6 +107,10 @@ $('#show-menu').click(function(event) { event.preventDefault(); $('#menu').toggle('slow'); }); +$('#book-list-nav h2').click(function(event) { + event.preventDefault(); + $('#book-list-nav-index').toggle(); +}); $('#themes-list-toggle').click(function(event) { @@ -126,6 +132,19 @@ $('#themes-list-toggle').click(function(event) { $(function(){ $("#search").search();}); + $('body').on('click', '.simple-toggler' , function(ev) { + ev.preventDefault(); + var scope = $(this).closest('.simple-toggler-scope'); + scope.find('.simple-hidden-box').each(function(){ + var $this = $(this); + if ($this.is(':hidden')) { + $this.show(); + } else { + $this.hide(); + } + }); + }); + }); })(jQuery);