Add audio bulk-download
[wolnelektury.git] / src / wolnelektury / static / js / book_text / references.js
index 3f5b7e3..394ec3f 100644 (file)
     $('a.anchor').on('click', function(e) {
         // Workaround for bad TOC markers.
         if ($(this).closest('#toc').length) return;
     $('a.anchor').on('click', function(e) {
         // Workaround for bad TOC markers.
         if ($(this).closest('#toc').length) return;
+        if ($(this).closest('.toc').length) return;
         if ($(this).closest('#wltoc').length) return;
         e.preventDefault();
 
         if ($(this).closest('#wltoc').length) return;
         e.preventDefault();
 
                         history.pushState({}, '', anchor);
                     },
                 });
                         history.pushState({}, '', anchor);
                     },
                 });
+                return true;
             }
         }
     }
     scrollToAnchor(window.location.hash)
             }
         }
     }
     scrollToAnchor(window.location.hash)
-    $('#toc, #themes, #book-text, #annotation').on('click', 'a', function(event) {
-        event.preventDefault();
-        scrollToAnchor($(this).attr('href'));
+    $('#toc, #themes, #book-text, #annotation, .scroll').on('click', 'a', function(event) {
+        if (scrollToAnchor($(this).attr('href'))) {
+            event.preventDefault();
+        }
     });
     });
-
     
 })})(jQuery);
     
 })})(jQuery);