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

(-)a/koha-tmpl/intranet-tmpl/prog/js/holds.js (-3 / +2 lines)
Lines 48-54 function display_pickup_location (state) { Link Here
48
            url = '/api/v1/holds/' + encodeURIComponent(hold_id) + '/pickup_locations';
48
            url = '/api/v1/holds/' + encodeURIComponent(hold_id) + '/pickup_locations';
49
        }
49
        }
50
50
51
        select.select2({
51
        select.kohaSelect({
52
            width: 'style',
52
            width: 'style',
53
            allowClear: false,
53
            allowClear: false,
54
            ajax: {
54
            ajax: {
Lines 82-89 function display_pickup_location (state) { Link Here
82
                        );
82
                        );
83
                    });
83
                    });
84
                    return { "results": results, "pagination": { "more": data.pagination.more } };
84
                    return { "results": results, "pagination": { "more": data.pagination.more } };
85
                },
85
                }
86
                transport: kohaSelect2Transport,
87
            },
86
            },
88
            templateResult: display_pickup_location
87
            templateResult: display_pickup_location
89
        });
88
        });
(-)a/koha-tmpl/intranet-tmpl/prog/js/select2.js (-21 lines)
Lines 38-63 $(document).ready(function(){ Link Here
38
    });
38
    });
39
});
39
});
40
40
41
function kohaSelect2Transport(params, success, failure) {
42
    var read_headers = function (data, textStatus, jqXHR) {
43
        var more = false;
44
        var link = jqXHR.getResponseHeader('Link') || '';
45
        if (link.search(/<([^>]+)>;\s*rel\s*=\s*['"]?next['"]?\s*(,|$)/i) > -1) {
46
            more = true;
47
        }
48
49
        return {
50
            results: data,
51
            pagination: {
52
                more: more
53
            }
54
        };
55
    };
56
    var $request = $.ajax(params);
57
    $request.then(read_headers).then(success);
58
    $request.fail(failure);
59
}
60
61
(function($) {
41
(function($) {
62
42
63
    /**
43
    /**
64
- 

Return to bug 29397