Pārlūkot izejas kodu

web intf: add some logic needed to prettify WiFi Downloads

Signed-off-by: Felix Paul Kühne <fkuehne@videolan.org>
Damien Erambert 11 gadi atpakaļ
vecāks
revīzija
52174fb5db
1 mainītis faili ar 30 papildinājumiem un 0 dzēšanām
  1. 30 0
      Resources/web/main.js

+ 30 - 0
Resources/web/main.js

@@ -100,4 +100,34 @@ $(function(){
         xhrCache.splice(id, 1);
         li.addClass('fail');
     }
+
+    function resizeThumbnails() {
+        $('.downloads > div').each(function(index, el) {
+            $(this).height(Math.ceil($(this).width()*0.55));
+        });
+    }
+
+    $(document).ready(function() {
+        resizeThumbnails()
+    });
+
+    $(window).resize(function(event) {
+        resizeThumbnails();
+    });
+
+    $('a.inner').click(function(event) {
+        $('#overlay').addClass('shown');
+        $('#modal ul.downloads').empty();
+        $(this).parent().find('.content > div').clone().appendTo('#modal ul.downloads');
+        resizeThumbnails();
+    });
+
+    $('#overlay').click(function(event) {
+        $(this).toggleClass('shown');
+    });
+
+    if('backgroundSize' in document.documentElement.style) {
+        $('.icon').addClass('bgz');
+    }
+
 });