Browse Source

Fix some cover stuff on the details page

spaghetti 7 years ago
parent
commit
88fce5b1f6
3 changed files with 5 additions and 7 deletions
  1. 1
    1
      sections/torrents/details.php
  2. 2
    2
      static/functions/cover_art.js
  3. 2
    4
      static/functions/global.js

+ 1
- 1
sections/torrents/details.php View File

206
             $Src = 'src="' . ImageTools::process($Image, true) . '"';
206
             $Src = 'src="' . ImageTools::process($Image, true) . '"';
207
           }
207
           }
208
 ?>
208
 ?>
209
-          <img id="cover_<?=$Index?>" class="lightbox-init" lightbox-img="<?=ImageTools::process($Image)?>" width="100%" <?=$Src?> alt="<?=$Summary?>" />
209
+          <img id="cover_<?=$Index?>" class="lightbox-init" width="100%" <?=$Src?> alt="<?=$Summary?>" />
210
         </div>
210
         </div>
211
         <ul class="stats nobullet">
211
         <ul class="stats nobullet">
212
           <li>
212
           <li>

+ 2
- 2
static/functions/cover_art.js View File

33
         $("#covers img").each(function() {
33
         $("#covers img").each(function() {
34
           $(this).attr("src", $(this).data("gazelle-temp-src"));
34
           $(this).attr("src", $(this).data("gazelle-temp-src"));
35
         });
35
         });
36
-        $("#covers div").each(function() {
36
+        $("#covers > div").each(function() {
37
           $(this).show();
37
           $(this).show();
38
           $(this).after("<span class=\"cover_seperator\"><br /><hr /><br /></span>");
38
           $(this).after("<span class=\"cover_seperator\"><br /><hr /><br /></span>");
39
           $(".next_cover").hide();
39
           $(".next_cover").hide();
43
       } else {
43
       } else {
44
         show_all = false;
44
         show_all = false;
45
         $(this).text("Show all");
45
         $(this).text("Show all");
46
-        $("#covers div").each(function() {
46
+        $("#covers > div").each(function() {
47
           if ($(this).attr("class") != "head") {
47
           if ($(this).attr("class") != "head") {
48
             if ($(this).attr("id") != current) {
48
             if ($(this).attr("id") != current) {
49
               $(this).hide();
49
               $(this).hide();

+ 2
- 4
static/functions/global.js View File

348
     })
348
     })
349
   })
349
   })
350
 
350
 
351
-  document.querySelectorAll('.lightbox-init').forEach(function(el) {
352
-    el.addEventListener('click', function(event) {
353
-      lightbox.init(el.attributes['lightbox-img']||el.src, el.attributes['lightbox-size']||el.width)
354
-    })
351
+  $(document).on('click', '.lightbox-init', function(e) {
352
+    lightbox.init(e.target.attributes['lightbox-img']||e.target.src, e.target.attributes['lightbox-size']||e.target.width)
355
   })
353
   })
356
 })
354
 })

Loading…
Cancel
Save