added link to PR, some cleaning
[wolnelektury.git] / wolnelektury / static / js / catalogue.js
index 71225e1..6715685 100644 (file)
@@ -391,7 +391,6 @@ function serverTime() {
                             $('#createNewShelf').show();
                         });
                 } catch (e){}
-                $("#putOnShelf input[type=checkbox]").attr("checked",false);
                 var serverResponse;
                 $('form', hash.w).ajaxForm({
                     target: serverResponse,
@@ -495,20 +494,19 @@ function serverTime() {
         // player for audiobooks
  
         // event handlers for playing different formats
-        $('p.header span').click(function(){
-            if(this.className != "desc"){
-                $('.audiobook-list').hide();
-                $('p.header span.active').attr('class', '');
-                // we don't want to interact with "audiobook" label, just 'format' tabs
-                this.className = "active";
-                $("#"+$("p.header span.active").html().toLowerCase()+"-files").show();
-            }
+        $('.audiotabs span').click(function(){
+            $('.audiobook-list').hide();
+            $('.audiotabs .active').removeClass('active');
+            // we don't want to interact with "audiobook" label, just 'format' tabs
+            var $this = $(this);
+            $this.addClass("active");
+            $("#"+$this.attr('data-format')+"-files").show();
         });
-        
-        
-        
+
         $('.audiobook-list').hide();
-        $("#"+$("p.header span.active").html().toLowerCase()+"-files").show();
+        if($(".audiotabs .active").length > 0) {
+            $("#"+$(".audiotabs .active").html().toLowerCase()+"-files").show();
+        }
         
         /* this will be useful for javascript html player
         var medias = $('.audiobook-list a');