X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/0c3e8f92c425a22c1b9da737db89977d31312353..9a7603cfbfdf7c0b4a2210ef454cecf894c5e172:/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 d43f1f23e..7db29ab24 100755
--- a/apps/wolnelektury_core/static/js/base.js
+++ b/apps/wolnelektury_core/static/js/base.js
@@ -59,6 +59,7 @@
 
 		(function() {
 			var $current = null;
+            var menu_loaded = false;
 			$('.hidden-box-wrapper').each(function() {
 				var $hidden = $('.hidden-box', this);
 				$('.hidden-box-trigger', this).click(function(event) {
@@ -70,6 +71,17 @@
 						$current && $current.hide('fast');
 						$hidden.show('fast');
 						$current = $hidden;
+                        if ($(this).hasClass('load-menu') && !menu_loaded) {
+                            $.ajax({
+                                url: '/katalog/',
+                                dataType: "json",
+                            }).done(function(data) {
+                                $.each(data, function(index, value) {
+                                    $('#menu-' + index).html(value);
+                                });
+                                menu_loaded = true;
+                            });
+                        }
 					} 
 				});
 			});
@@ -89,6 +101,14 @@
 		})();
 		
 
+$('#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) {