Adding library own page
[wolnelektury.git] / apps / wolnelektury_core / static / js / base.js
index 77315e6..9676d5b 100755 (executable)
@@ -59,6 +59,7 @@
 
                (function() {
                        var $current = null;
 
                (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) {
                        $('.hidden-box-wrapper').each(function() {
                                var $hidden = $('.hidden-box', this);
                                $('.hidden-box-trigger', this).click(function(event) {
                                                $current && $current.hide('fast');
                                                $hidden.show('fast');
                                                $current = $hidden;
                                                $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;
+                            });
+                        }
                                        } 
                                });
                        });
                                        } 
                                });
                        });
@@ -97,15 +109,6 @@ $('#themes-list-toggle').click(function(event) {
 });
 
 
 });
 
 
-$('.open-player').click(function(event) {
-    event.preventDefault();
-    window.open($(this).attr('href'),
-        'player',
-        'width=422, height=500'
-        );
-});
-
-
         $('.book-list-index').click(function(){
             $('.book-list-show-index').hide('slow');
             if($(this).parent().next('ul:not(:hidden)').length == 0){
         $('.book-list-index').click(function(){
             $('.book-list-show-index').hide('slow');
             if($(this).parent().next('ul:not(:hidden)').length == 0){