Simplify transitional files a bit.
[wolnelektury.git] / src / wolnelektury / static / js / base.js
index 8502d62..8f26db4 100644 (file)
             $("iframe", this).attr("src", $("iframe", this).attr('data-src'));
         });
 
             $("iframe", this).attr("src", $("iframe", this).attr('data-src'));
         });
 
-        $(".media-eink .carousel").cycle({fx: "none"});
+        $(".carousel").each(function() {
+            opts = {};
+            if ($('html').hasClass('media-eink')) {
+                opts.fx = 'none'
+            }
+            $(this).cycle(opts);
+        });
 
 
         (function() {
 
 
         (function() {
         });
 
         $('.hoverclick').click(function() {$(this).closest('.hoverget').toggleClass('hover');});
         });
 
         $('.hoverclick').click(function() {$(this).closest('.hoverget').toggleClass('hover');});
+        $('.hoverclick').keydown(function(event){ 
+            var keyCode = (event.keyCode ? event.keyCode : event.which);   
+            if (keyCode == 13) {
+                $(this).trigger('click');
+            }
+        });
 
         $(function(){
             $("#search").search();
 
         $(function(){
             $("#search").search();
             return false;
         });
 
             return false;
         });
 
+        $("#id_method").val('payu-re');
+        $(".methods .button").click(function() {
+            $("#id_method").val($(this).attr('data-method'));
+            $(".methods .button").removeClass('active');
+            $(this).addClass("active");
+        });
+
+
+        $("#skiplink-search").click(function() {
+            console.log('skiplink search');
+            $("#search").focus();
+            return false;
+        });
+        
     });
 })(jQuery);
 
     });
 })(jQuery);