|
Lines 46-53
function verify_cover_images() {
Link Here
|
| 46 |
if ( (img.complete != null) && (!img.complete) || img.naturalHeight == 0 ) { |
46 |
if ( (img.complete != null) && (!img.complete) || img.naturalHeight == 0 ) { |
| 47 |
/* No image was loaded via the CustomCoverImages system preference */ |
47 |
/* No image was loaded via the CustomCoverImages system preference */ |
| 48 |
/* Remove the container */ |
48 |
/* Remove the container */ |
| 49 |
blanks.push( coverId ); |
|
|
| 50 |
div.remove(); |
49 |
div.remove(); |
|
|
50 |
blanks.push( coverId ); |
| 51 |
} |
51 |
} |
| 52 |
} |
52 |
} |
| 53 |
|
53 |
|
|
Lines 75-84
function verify_cover_images() {
Link Here
|
| 75 |
} |
75 |
} |
| 76 |
} /* /IF image loaded */ |
76 |
} /* /IF image loaded */ |
| 77 |
} else { |
77 |
} else { |
| 78 |
blanks.push( coverId ); |
|
|
| 79 |
div.remove(); |
78 |
div.remove(); |
|
|
79 |
blanks.push( coverId ); |
| 80 |
} /* /IF there is an image tag */ |
80 |
} /* /IF there is an image tag */ |
| 81 |
/* console.log( coverImages ); */ |
|
|
| 82 |
}); |
81 |
}); |
| 83 |
|
82 |
|
| 84 |
/* Show the first cover image slide after empty ones have been removed */ |
83 |
/* Show the first cover image slide after empty ones have been removed */ |
|
Lines 100-107
function verify_cover_images() {
Link Here
|
| 100 |
}); |
99 |
}); |
| 101 |
} |
100 |
} |
| 102 |
|
101 |
|
|
|
102 |
let counter_wait = 0; |
| 103 |
function wait_for_images(cb){ |
| 104 |
|
| 105 |
var loaded = 1; |
| 106 |
counter_wait++; |
| 107 |
|
| 108 |
if ( loaded ) { |
| 109 |
loaded = KOHA.coce.done; |
| 110 |
} |
| 111 |
|
| 112 |
if (!loaded && counter_wait < 50) {// Do not wait more than 5 seconds |
| 113 |
window.setTimeout(function(){wait_for_images(cb);}, 100); |
| 114 |
} else { |
| 115 |
if (counter_wait >= 50 ) { |
| 116 |
console.log("Could not retrieve the images") |
| 117 |
} |
| 118 |
cb(); |
| 119 |
} |
| 120 |
} |
| 121 |
|
| 103 |
$(window).load(function() { |
122 |
$(window).load(function() { |
| 104 |
verify_cover_images(); |
123 |
wait_for_images(verify_cover_images); |
| 105 |
}); |
124 |
}); |
| 106 |
|
125 |
|
| 107 |
var Sticky; |
126 |
var Sticky; |
| 108 |
- |
|
|