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 1606-1614 Note that permanent location is a code, and location may be an authval. Link Here
1606
             });
1606
             });
1607
        });
1607
        });
1608
1608
1609
        $(window).load(function() {
1609
1610
            verify_cover_images();
1610
        [% IF ( IntranetCoce && CoceProviders ) %]
1611
        });
1611
            let counter_wait = 0;
1612
            function wait_for_images(cb){
1613
1614
                var loaded = 1;
1615
                counter_wait++;
1616
1617
                if ( loaded ) {
1618
                    loaded = KOHA.coce.done;
1619
                }
1620
1621
                if (!loaded && counter_wait < 50) {// Do not wait more than 5 seconds
1622
                    window.setTimeout(function(){wait_for_images(cb);}, 100);
1623
                } else {
1624
                    if (counter_wait >= 50 ) {
1625
                        console.log("Could not retrieve the images")
1626
                    }
1627
                    cb();
1628
                }
1629
            }
1630
1631
            $(window).load(function() {
1632
                wait_for_images(verify_cover_images);
1633
            });
1634
        [% ELSE %]
1635
            $(window).load(function() {
1636
                verify_cover_images;
1637
            });
1638
        [% END %]
1612
    </script>
1639
    </script>
1613
    [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && ( normalized_isbn || normalized_upc ) ) %]
1640
    [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && ( normalized_isbn || normalized_upc ) ) %]
1614
        <script src="https://imageserver.ebscohost.com/novelistselect/ns2init.js"></script>
1641
        <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