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

(-)a/koha-tmpl/intranet-tmpl/js/coce.js (-2 / +4 lines)
Lines 20-26 KOHA.coce = { Link Here
20
            var id = $(this).attr("class"); // id=isbn
20
            var id = $(this).attr("class"); // id=isbn
21
            if (id !== '') { ids.push(id); }
21
            if (id !== '') { ids.push(id); }
22
        });
22
        });
23
        if (ids.length == 0) return;
23
        if (ids.length == 0) { this.done = 1; return; }
24
        ids = ids.join(',');
24
        ids = ids.join(',');
25
        var coceURL = host + '/cover?id=' + ids + '&provider=' + provider;
25
        var coceURL = host + '/cover?id=' + ids + '&provider=' + provider;
26
        $.ajax({
26
        $.ajax({
Lines 44-50 KOHA.coce = { Link Here
44
                    });
44
                    });
45
                }
45
                }
46
            },
46
            },
47
47
        }).then(function(){
48
            // Cannot access 'this' from here
49
            KOHA.coce.done = 1;
48
        });
50
        });
49
    }
51
    }
50
52
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt (-3 / +30 lines)
Lines 1600-1608 Note that permanent location is a code, and location may be an authval. Link Here
1600
             });
1600
             });
1601
        });
1601
        });
1602
1602
1603
        $(window).load(function() {
1603
1604
            verify_cover_images();
1604
        [% IF ( IntranetCoce && CoceProviders ) %]
1605
        });
1605
            let counter_wait = 0;
1606
            function wait_for_images(cb){
1607
1608
                var loaded = 1;
1609
                counter_wait++;
1610
1611
                if ( loaded ) {
1612
                    loaded = KOHA.coce.done;
1613
                }
1614
1615
                if (!loaded && counter_wait < 50) {// Do not wait more than 5 seconds
1616
                    window.setTimeout(function(){wait_for_images(cb);}, 100);
1617
                } else {
1618
                    if (counter_wait >= 50 ) {
1619
                        console.log("Could not retrieve the images")
1620
                    }
1621
                    cb();
1622
                }
1623
            }
1624
1625
            $(window).load(function() {
1626
                wait_for_images(verify_cover_images);
1627
            });
1628
        [% ELSE %]
1629
            $(window).load(function() {
1630
                verify_cover_images;
1631
            });
1632
        [% END %]
1606
    </script>
1633
    </script>
1607
    [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && ( normalized_isbn || normalized_upc ) ) %]
1634
    [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && ( normalized_isbn || normalized_upc ) ) %]
1608
        <script src="https://imageserver.ebscohost.com/novelistselect/ns2init.js"></script>
1635
        <script src="https://imageserver.ebscohost.com/novelistselect/ns2init.js"></script>
(-)a/koha-tmpl/opac-tmpl/bootstrap/js/coce.js (-3 / +3 lines)
Lines 44-52 KOHA.coce = { Link Here
44
                    });
44
                    });
45
                }
45
                }
46
            },
46
            },
47
47
        }).then(function(){
48
            // Cannot access 'this' from here
49
            KOHA.coce.done = 1;
48
        });
50
        });
49
        this.done = 1;
50
    }
51
    }
51
52
52
};
53
};
53
- 

Return to bug 32307