Browse Source

Don't preload cover images

spaghetti 7 years ago
parent
commit
a68f182264
2 changed files with 6 additions and 1 deletions
  1. 2
    0
      static/functions/browse.js
  2. 4
    1
      static/functions/global.js

+ 2
- 0
static/functions/browse.js View File

280
     var els = $('#torrent_table.grouping .colhead td:first-child(), #torrent_table.grouping .colhead_dark td:first-child(), #torrent_table.grouping .torrent td:first-child()')
280
     var els = $('#torrent_table.grouping .colhead td:first-child(), #torrent_table.grouping .colhead_dark td:first-child(), #torrent_table.grouping .torrent td:first-child()')
281
     for (var i = 0; i < els.length; i++) { els[i].style.display = 'none' }
281
     for (var i = 0; i < els.length; i++) { els[i].style.display = 'none' }
282
   }
282
   }
283
+/*
283
   //Preload first result's cover
284
   //Preload first result's cover
284
   if ($('#torrent_table').length > 0) {
285
   if ($('#torrent_table').length > 0) {
285
     var a = $('a[data-cover]')[0]
286
     var a = $('a[data-cover]')[0]
286
     if (a) preload(a.attributes['data-cover'].value)
287
     if (a) preload(a.attributes['data-cover'].value)
287
   }
288
   }
289
+ */
288
 })
290
 })

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

311
   $('#coverCont img')[0].src = image?image:'/static/common/noartwork/nocover.png'
311
   $('#coverCont img')[0].src = image?image:'/static/common/noartwork/nocover.png'
312
   coverCont.className = (event.clientX > (window.innerWidth/2)) ? 'left' : 'right'
312
   coverCont.className = (event.clientX > (window.innerWidth/2)) ? 'left' : 'right'
313
   coverCont.style.display = 'block'
313
   coverCont.style.display = 'block'
314
+/*
314
   //Preload next image
315
   //Preload next image
315
   if ($('.torrent_table, .request_table').length > 0) {
316
   if ($('.torrent_table, .request_table').length > 0) {
316
     var as = $('[data-cover]')
317
     var as = $('[data-cover]')
318
     preload((as[as.toArray().indexOf(a)+1]||as[0]).attributes['data-cover'].value)
319
     preload((as[as.toArray().indexOf(a)+1]||as[0]).attributes['data-cover'].value)
319
     preload((as[as.toArray().indexOf(a)-1]||as[0]).attributes['data-cover'].value)
320
     preload((as[as.toArray().indexOf(a)-1]||as[0]).attributes['data-cover'].value)
320
   }
321
   }
322
+*/
321
 }
323
 }
322
 function ungetCover(event) {
324
 function ungetCover(event) {
323
   $('#coverCont img').remove()
325
   $('#coverCont img').remove()
331
 }
333
 }
332
 
334
 
333
 $(function() {
335
 $(function() {
336
+/*
334
   if ($('.request_table').length > 0) {
337
   if ($('.request_table').length > 0) {
335
     var a = $('[data-cover]')[0]
338
     var a = $('[data-cover]')[0]
336
     if (a) preload(a.attributes['data-cover'].value)
339
     if (a) preload(a.attributes['data-cover'].value)
337
   }
340
   }
338
-
341
+*/
339
   document.querySelectorAll('[data-toggle-target]').forEach(function(el) {
342
   document.querySelectorAll('[data-toggle-target]').forEach(function(el) {
340
     el.addEventListener('click', function(event) {
343
     el.addEventListener('click', function(event) {
341
       $(el.attributes['data-toggle-target'].value).gtoggle()
344
       $(el.attributes['data-toggle-target'].value).gtoggle()

Loading…
Cancel
Save