View | Details | Raw Unified | Return to bug 32542
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/js/pages/results.js (-4 / +29 lines)
Lines 130-138 function verify_cover_images() { Link Here
130
    });
130
    });
131
}
131
}
132
132
133
$(window).load(function () {
133
if (PREF_IntranetCoce && PREF_CoceProviders) {
134
    verify_cover_images();
134
    let counter_wait = 0;
135
});
135
    function wait_for_images(cb){
136
137
        var loaded = 1;
138
        counter_wait++;
139
140
        if ( loaded ) {
141
            loaded = KOHA.coce.done;
142
        }
143
144
        if (!loaded && counter_wait < 50) {// Do not wait more than 5 seconds
145
            window.setTimeout(function(){wait_for_images(cb);}, 100);
146
        } else {
147
            if (counter_wait >= 50 ) {
148
                console.log("Could not retrieve the images")
149
            }
150
            cb();
151
        }
152
    }
153
154
    $(window).load(function() {
155
        wait_for_images(verify_cover_images);
156
    });
157
} else {
158
    $(window).load(function() {
159
        verify_cover_images();
160
    });
161
}
136
162
137
var toHighlight = {};
163
var toHighlight = {};
138
var q_array;
164
var q_array;
139
- 

Return to bug 32542